该文章恢复至 2021年01月19日 的文章
json数据:$json = ‘{“state”: “1”,”test”: “2”}’;
json解析:$de_json = json_decode(【json数据】,true);
输出json内的数据:echo $de_json[‘state’];//输出结果为 1
解析例子:
$json = '{"state": "1","test": "2"}';
$de_json = json_decode($json,true);
echo $de_json['state']; //输出state内的数据,输出结果为1
echo $de_json['test']; //输出test内的数据,输出结果为2