给定一个数组:
{"aaData":[
{"first":2, "second":"4", "third":"5"},
{"first":4, "second":"56", "third":"67"}
{"first":3, "second":"55", "third":"8"}],
"sEcho":1, "iTotalRecords":1, "iTotalDisplayRecords":1}
当我阅读并返回它时:
$json_string = 'my_url';
$jsondata = file_get_contents($json_string);
$obj = json_decode($jsondata);
return array('sEcho'=> 1,
'iTotalRecords'=> 5,
'iTotalDisplayRecords'=> 5,
'aaData'=>array(
array($obj->aaData[0]->first,
$obj->aaData[0]->second,
$obj->aaData[0]->third)
)
);
我只得到第一项aaData
:{"first":2,"second":"4","third":"5"}
但我需要从中获取所有内容my_url
。我该怎么做?