当前位置:Gxlcms > PHP教程 > 求大侠讲解json字符串处理方案,多谢

求大侠讲解json字符串处理方案,多谢

时间:2021-07-01 10:21:17 帮助过:4人阅读

求大侠讲解json字符串处理方案,谢谢
PHP code




求解 json_decode()函数无法处理该json字符串求各位大侠赐教 小弟万分感谢 !

------解决方案--------------------
$string = iconv('gbk', 'utf-8', $string);
$array=json_decode($string,true);
var_dump($array);

json_decode 只能处理 utf-8 编码的 json 串
------解决方案--------------------
GBK编码吧?

如下

$array=(array)json_decode(iconv('GBK', 'UTF-8', $string),true);

人气教程排行