here is a multi-dimensional json data, which can be converted into an array of php through json_decode. How to traverse the news headlines?
https://www.baidu.com/s?wd=.
here is a multi-dimensional json data, which can be converted into an array of php through json_decode. How to traverse the news headlines?
https://www.baidu.com/s?wd=.
$json = file_get_contents('http://www.baidu.com/s?wd=%E5%AE%B6%E6%9C%89%E7%BD%91&pn=50&rn=50&tn=json');
$json = json_decode($json,TRUE);
$entry = $json['feed']['entry'];
foreach($entry as $k => $v)
{
if(!empty($v))
{
var_dump($v['title']);
}
}
Previous: The problem of selecting the minimum value in the array
Next: How to remove specify listener in js (not written by yourself)