phpdecode字符串包含中文,结果为null的问题
1:转码,建议转成utf-8再decode
$fields='[{"money":"200","getexo":"150","statusNum":"12","visitTime":"1278500954","id":"1","name":"化石1","changestatus2":"7200","stoneid":"1","changestatus3":"18000","changestatus1":"600","changestatus4":"72000","getmoney":"500"},{"money":"250","getexo":"180","statusNum":"12","visitTime":"1278511854","id":"2","name":"化石1","changestatus2":"7200","stoneid":"1","changestatus3":"18000","changestatus1":"600","changestatus4":"72000","getmoney":"600"}]';
$fields=iconv('gb2312','utf-8',$fields);
$fields1=json_decode($fields);
$fields=iconv('gb2312','utf-8',$fields);
$fields1=json_decode($fields);
2、只能使用双引号(")
在JSON里只用"来表示字符串号
3、不能有多余的逗号(,)
4、不支持一些转义
字符的表示方式方式有很多种,但下面的都不支持
\x26