用于unicode的php正则表达式
我有一些文本,unicode是这样写的用于unicode的php正则表达式,php,regex,Php,Regex,我有一些文本,unicode是这样写的 There areu25ba 2 boys. There are► 2 boys. 应该是这样的 There areu25ba 2 boys. There are► 2 boys. 如果存在unicode字符,则将“u”替换为“” 提前感谢天真的做法是: preg_replace('/u([0-9a-fA-F]{4})/','&#x$1;',$string); 但我怀疑“乌达夫”会不会感激它。
There areu25ba 2 boys.
There are► 2 boys.
应该是这样的
There areu25ba 2 boys.
There are► 2 boys.
如果存在unicode字符,则将“u”替换为“”
提前感谢天真的做法是:
preg_replace('/u([0-9a-fA-F]{4})/','&#x$1;',$string);
但我怀疑“乌达夫”会不会感激它。是的。我只需要在html页面中显示字符,而不是unicode textWrikken,我已经尝试运行此代码。但它不是印刷品。echo(preg_replace(“/u[0-9a-fA-F]{4}/”、“$1”、“u25ba工程?”);沙希德:你也错过了正则表达式本身的一个更新(Gumbo指出了这一点),现在答案是固定的。