unicode 字符串转中文方法:
function u2c($str){
return preg_replace_callback("#\\\u([0-9a-f]{4})#i",
function ($r) {
return iconv('UCS-2BE', 'UTF-8', pack('H4', $r[1]));},$str);
}
$string = '\u4f60\u597d\uff0c\u8fd9\u91cc\u662f\u96f6\u4e94\u7f51\u5728\u7ebf\u5de5\u5177\u7bb1\uff0c\u7f51\u5740\uff1ahttps://tools.02405.com\uff0c\u6b22\u8fce\u4f7f\u7528\u3002\u5982\u679c\u89c9\u5f97\u597d\u7528\uff0c\u8bf7\u5206\u4eab\uff01';
var_dump(u2c($string));
输出:
"你好,这里是零五网在线工具箱,网址:https://tools.02405.com,欢迎使用。如果觉得好用,请分享!"