
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,我们会在看到邮件的第一时间内为您处理!

一个由国家统计局开发和管理的官方网站——中国国家数据平台
魔顿官网:一个集资源下载、教程、互动于一体的C4D资源平台
宝藏网站:抖音大佬都不可能告诉你的“四个网站”
edx在线课程平台官网入口,一个由哈佛大学和麻省理工学院创办的平台