Splitting a unicode string into individual characters in PHP
I had a hard time finding something that can easily split a unicode string into individual unicode characters. Finally, I find something here http://bugs.php.net/bug.php?id=27103 that gave a straightforward method to do the splitting. Here is the code:
$s = "यहां पर एक युनिकोड लड़ी (string) डालें";
print "<pre>";
print_r( preg_split("//u", $s, -1, PREG_SPLIT_NO_EMPTY));
print "</pre>";
The above code will output the individual letters in the string $s. Feel free to adapt to it your needs. Cheers!