PHP解析JSON数据的源代码

来源:互联网 发布:淘宝拔草少年真货假货 编辑:程序博客网 时间:2024/05/19 06:39
 
$json_string='{"id":1,"name":"foo","email":"foo@foobar.com","interest":["wordpress","php"]} ';$obj=json_decode($json_string);echo $obj->name; //prints fooecho $obj->interest[1]; //prints php