$string = '搞定';
$string = preg_replace_callback("/(&#.+?;)/", function ($m) {
return mb_convert_encoding($m[1], "UTF-8", "HTML-ENTITIES");
}, $string);
echo $string; // 搞定
$string = '搞定';
$string = preg_replace_callback("/(&#.+?;)/", function ($m) {
return mb_convert_encoding($m[1], "UTF-8", "HTML-ENTITIES");
}, $string);
echo $string; // 搞定
本文标题:符号变中文(php版本)
本文链接:https://www.haomeiwen.com/subject/xehcrctx.html
网友评论