
php如何把unicode编码过的json中文编码转成中文,下面web建站小编给大家简单介绍一下实现代码!
具体代码如下:
function unicodeDecode($unicode_str){
$unicode_str = str_replace('"', '\"', $unicode_str);
$unicode_str = str_replace("'", "\'", $unicode_str);
$json = '{"str":"'.$unicode_str.'"}';
$arr = json_decode($json,true);
if(empty($arr)){
return '';
}
return $arr['str'];
}
标签: json_decode, unicode编码
上面是“php如何把unicode编码过的json中文编码转成中文”的全面内容,想了解更多关于 php入门 内容,请继续关注web建站教程。
当前网址:https://m.ipkd.cn/webs_3265.html
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

edx在线课程平台官网入口,一个由哈佛大学和麻省理工学院创办的平台
vue项目引入谷歌广告报Adsense错误:TagError: adsbygoogle.push() error: All ins elements...解决方法
OA图书馆:一个致力于让中国人免费获得高质量文献的在线平台