Re: substr and UTF-8

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

 



Peter Lauri wrote:
> Hi group,
> 
> I want to limit the number of characters that are shown in a script. The
> characters happen to be Thai, and the page is encoded in UTF-8. Everything
> works, except when I want to cut the text (just take start of string).
> 
> I do:
> 
> echo substr($thaistring, 0, 30);
> 
> The beginning of the string works fine, but the last character does mostly
> "break". How can I determine the start and end of a character.

become familiar with (and install) the mb_string extension

> 
> I hope the problem is clear enough, is it? :)
> 
> Best regards,
> Peter Lauri
> 
> www.lauri.se - personal web site
> www.dwsasia.com - company web site
> 

-- 
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