对其中的另一个感到抱歉。
json 以这种格式返回:
{
"data":{
"internalName":"hotshotgg",
"name":"HotshotGG",
"acctId":434582,
"profileIconId":531,
"revisionDate":"\/Date(1357002079809)\/",
"summonerLevel":30,
"summonerId":407750
},
"success":true
}
也可以在这里看到:http: //elophant.com/developers/docs/summoner
数据正确返回:
Array (
[data] => Array (
[internalName] => nemonorm
[name] => nemonorm
[acctId] => 28685607
[profileIconId] => 544
[revisionDate] => /Date(1361354064000)/
[summonerLevel] => 30
[summonerId] => 24286314
)
[success] => 1
)
我似乎无法循环并打印出我想要的信息:
$decode= json_decode($url, true);
foreach($decode['data'] as $key => $value) {
echo $value['name'] . " <br />";
}
很确定这是显而易见的……但我看不到。