php使用json_decode解析json数据失败怎么办?
网友回复
将数据先进行htmlspecialchars_decode,在执行json_decode,因为有的时候json字符串中有非法字符导致解析失败。
<?php $jsonstr="\\"; json_decode(htmlspecialchars_decode($jsonstr));
php使用json_decode解析json数据失败怎么办?
网友回复
将数据先进行htmlspecialchars_decode,在执行json_decode,因为有的时候json字符串中有非法字符导致解析失败。
<?php $jsonstr="\\"; json_decode(htmlspecialchars_decode($jsonstr));