Chinese, Thai, Japanese, Korean, Arabic, Hebrew and other non-latin characters are of more than one character length in real terms.
Since an alphabet takes more than one byte it is not considered as single character by PHP engine, thus it chops off some characters sometimes, thus operating on text in these languages with SUBSTR function is not recommended. Thus
However there is another function mb_substr() it only cuts the string after a proper end of character.
Eg usage : $final_string=mb_substr($initial_string,0,50) instead of $final_string=substr($initial_string,0,50)
- Permalink
- The Analyst
- 13 Feb 2010 7:03 AM
- Comments (1)
December 22nd, 2011 at 11:01 pm
Thanks,
Its resolved my problem.