注意:未定义的偏移量:0行36

时间:2016-08-07 14:13:29

标签: php

错误 注意:未定义的偏移量:0第37行

第37行

$table = (table2)["response"]["players"][0];

小切

    ");
}

$steamid64 = $_GET["steamid"];

$url = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=" . $SteamAPIKey . "&steamids=" . $steamid64;
$json = file_get_contents($url);
$table2 = json_decode($json, true);
//Undefined Variable which means it hasn't been Verified.
$table = $table2["response"]["players"][0];
print_r($table2);

?>

1 个答案:

答案 0 :(得分:0)

你可以使用print_r($ table2);在获得第一项玩家之前,了解$ tables的结构。

例如: 取代

$table = $table2["response"]["players"][0];
print_r($table2);

通过

print_r($table2);
$table = $table2["response"]["players"][0];