我有一些文字,其中Unicode是写成文字这样PHP正则表达式对Unicode
There areu25ba 2 boys.
它应该是这样的
There are► 2 boys.
替换“U”与“&#X”如果有unicode字符。
在此先感谢
我有一些文字,其中Unicode是写成文字这样PHP正则表达式对Unicode
There areu25ba 2 boys.
它应该是这样的
There are► 2 boys.
替换“U”与“&#X”如果有unicode字符。
在此先感谢
一个天真的方法是:
preg_replace('/u([0-9a-fA-F]{4})/','&#x$1;',$string);
但我怀疑 'udaff' 将不胜感激。
当然'►'? – Wrikken 2010-10-01 14:18:51
是的。我只需要在html页面中显示字符而不是unicode文本 – Novice 2010-10-01 14:21:54