[php]解析JSON文字列

335 ワード

$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