PHP, mbstring, UTF-8 and indexing strings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux