PHP, mbstring, UTF-8 and indexing strings
| From: | delsvr | Date: | Sun, 24 Jun 2007 15:15:41 +0000 |
| Subject: | PHP, mbstring, UTF-8 and indexing strings | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-257730@lists.php.net to get a copy of this message | ||
Just a simple question (with a simple answer, hopefully): how can I access
character x of a utf-8 encoded string? i.e. how would I get this to work:
for($x=0; $x < strlen($utf8); $x++)
echo "character {$x}:" . $utf8{$x};
Keep in mind that I have strlen overloaded by mbstring, and this is
necessary for my purposes because I need to do work on each character. Also,
by "character" I mean, for example: "我".
Thanks,
delsvr
--
View this message in context: http://www.nabble.com/PHP%2C-mbstring%2C-UTF-8-and-indexing-strings-tf3972397.html#a11275585
Sent from the PHP - General mailing list archive at Nabble.com.