我試圖從JSON訂閱源中使用特定的對象類型,並且很難指定它。使用代碼下面我抓住並打印特定陣列(最大)我想,從JSON指定PHP數組中的對象
$jsonurl = "LINK";
$json = file_get_contents($jsonurl,0,null,null);
$json_output = json_decode($json,true);
$max_output = $json_output["max"];
echo '<pre>';
print_r($max_output);
echo '</pre>';
而從下面的陣列,所有我想使用的是每個陣列中的[1]對象。我如何指定並獲取這些值?
Array
(
[0] => Array
(
[0] => 1309924800000
[1] => 28877
)
[1] => Array
(
[0] => 1310011200000
[1] => 29807
)
[2] => Array
(
[0] => 1310097600000
[1] => 33345
)
[3] => Array
(
[0] => 1310184000000
[1] => 33345
)
[4] => Array
(
[0] => 1310270400000
[1] => 33345
)
[5] => Array
(
[0] => 1310356800000
[1] => 40703
)
的可能重複(http://stackoverflow.com/questions/1494953/is-there-a-function-to-extract-a-array-from-an-array-in-php) – 2012-02-14 18:59:36