如题所述
<?php
header('Content-type:text/html;charset=utf-8');
function dotrans($code)
{
return preg_replace("#\\\u([0-9a-f]+)#ie", "iconv('UCS-2', 'UTF-8', pack('H4', '\\1'))",
$code);
}
$a = '\u4e2d\u6587\u5b57\u7b26\u4e32';
echo dotrans($a);
?>
è¿è¡ç»æï¼ ä¸æå符串
header('Content-type:text/html;charset=utf-8');
function dotrans($code)
{
return preg_replace("#\\\u([0-9a-f]+)#ie", "iconv('UCS-2', 'UTF-8', pack('H4', '\\1'))",
$code);
}
$a = '\u4e2d\u6587\u5b57\u7b26\u4e32';
echo dotrans($a);
?>
è¿è¡ç»æï¼ ä¸æå符串
温馨提示:答案为网友推荐,仅供参考