This is a discussion on Help preg_replace with Non-English character within the PHP General forums, part of the PHP Programming Forums category; Hi all, Just a question, I want to replace some Chinese characters with preg_replace(). But it does not work. The ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi all,
Just a question, I want to replace some Chinese characters with preg_replace(). But it does not work. The string is $str = 'test<<*好>>http://www.phparch.cn/ 完成'; The ideal output is : test<a href="http://www.phparch.cn">*好</a> 完成 Any suggestion will be greatly appreciated. -- Regards, Shelley |
|
|||
|
> Just a question, I want to replace some Chinese characters with
> preg_replace(). > > But it does not work. > > The string is > > $str = 'test<<*好>>http://www.phparch.cn/ 完成'; > > The ideal output is : > test<a href="http://www.phparch.cn">*好</a> 完成 > > Any suggestion will be greatly appreciated. Have a look to see if the mb_* functions will help. http://uk3.php.net/manual/en/book.mbstring.php -- Richard Heyes In Cambridge? Employ me http://www.phpguru.org/cv +----------------------------------------+ | Access SSH with a Windows mapped drive | | http://www.phpguru.org/sftpdrive | +----------------------------------------+ |