[Ilugc] [ilugc] [PHP] Need help in program

  • From: tshrinivasan@xxxxxxxxx (Shrinivasan T)
  • Date: Tue, 10 Jan 2012 18:56:09 +0530

The answer is given here:
http://stackoverflow.com/questions/8798248/how-to-split-tamil-characters-in-a-string-in-php

<quote>

I think you should be able to use the grapheme_extract [1] function to
iterate over the combined characters (which are technically called
"grapheme clusters").

Alternatively, if you prefer the regex approach, I think you can use this:

preg_match_all('/\pL\pM*|./u', $str, $results)

where \pL means a Unicode "letter", and \pM means a Unicode "mark".

</quote>

[1] http://php.net/manual/en/function.grapheme-extract.php
--
Regards,
T.Shrinivasan


My Life with GNU/Linux : http://goinggnu.wordpress.com
Free/Open Source Jobs : http://fossjobs.in

Get CollabNet Subversion Edge : ? ? http://www.collab.net/svnedge

Other related posts: