我有這個數組,我想從中獲取ID和說明。而我得到的是陣列陣列陣列... :-)獲取兩個值的數組問題
function getCountries() {
$json = file_get_contents('http://onleague.stormrise.pt:8031/OnLeagueRest/resources/onleague/Utils/Countries');
$data = json_decode($json, TRUE);
$countries = array();
foreach($data['data']['item'] as $item) {
$countries[] = $item;
}
//print_r($countries);
foreach($countries as $v)
{
echo $v.'<br />';
}
}
getCountries();
'print_r($ countries)'是什麼結果? – Neal 2011-05-23 19:42:43