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

jQuery利用reset函数清空(重置)form表单数据
帝国CMS搜索页模板关键字结果如何让标题加红
一款将知识内容转化为数字化形式的一站式知识付费平台——海豚知道