引用 楼主 giopan 的回复:
各位老师好,我从接口中获取了如下的json,希望用php将json转化为数组后,获取json中的每一个值,该如何写代码呢?麻烦各位老师贴个例子,感谢!
json:
{"isUseridBindingMe":1,"students":[{"schoolId":9,"schoolName":"测试","studentCode":"abcde","gender":2,"testCode":"test"}],"xxName":"好好好","teleph":"13800138000","gender":2}
json为上面的json,以下这样写哪里错了?然后要怎么获取数组的值?感谢~
$str1=json_decode(json);
$UARR=array(
'studentCode'=>$str1->studentCode,
);