[php] 解析JSON字符串

$json_str = '{"thumb":"","photo":[{"url":"557a3d2184db0.png","alt":"SafeBoot\u6ce8\u518c\u8868"}]}';  // json字符串
$obj = json_decode($json_str);
$photo = $obj->photo;
$url = $photo[0]->url; // echo url; //557a3d2184db0.png

  

posted @ 2015-06-12 10:41  捕蛇者说  阅读(1901)  评论(0编辑  收藏  举报