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

手游《幻兽帕鲁》银钥匙获取攻略
MeteoRA:南京大学开发的高效多任务嵌入框架,助力大语言模型性能飞跃