如何使用PHP高效解析JSON数据?
- 内容介绍
- 文章标签
- 相关推荐
本文共计44个文字,预计阅读时间需要1分钟。
json{ id: 1, name: rolf, country: russia, office: [google, oracle]}
$json_string='{"id":1,"name":"rolf","country":"russia","office":["google","oracle"]} '; $obj=json_decode($json_string); //print the parsed data echo $obj->name; //displays rolf echo $obj->office[0]; //displays google
本文共计44个文字,预计阅读时间需要1分钟。
json{ id: 1, name: rolf, country: russia, office: [google, oracle]}
$json_string='{"id":1,"name":"rolf","country":"russia","office":["google","oracle"]} '; $obj=json_decode($json_string); //print the parsed data echo $obj->name; //displays rolf echo $obj->office[0]; //displays google

