Posted by Mathias K. on 07/19/07 16:15
Hello!
Could anyone give me a hint how to split up an utf8 string character-wise
with PHP?
In my case it's a Japanese string. As the lengths of each Japanese
character can differ from 2 to 6 bytes i don't know how to find out where
one character begins and the other ends.
I tried splitting it up with mb_split:
$departed = implode('<br>', mb_split("\w", $word));
Well it doesn't seem to work. The Japanese character totally get messed up.
Does anyone have a clue what regex to use or how else i could split a
Japanese string character wise?
Thanks in advance!
~ Mathias
Navigation:
[Reply to this message]
|