Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 注意:未定义的偏移量:0第36行_Php - Fatal编程技术网

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

Php 注意:未定义的偏移量:0第36行,php,Php,错误 注意到:未定义的偏移量:0第37行 第37行 $table = (table2)["response"]["players"][0]; 小切口 "); } $steamid64 = $_GET["steamid"]; $url = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=" . $SteamAPIKey . "&steamids=" . $steamid64; $jso

错误 注意到:未定义的偏移量: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);

?>
您可以使用print\u r($table2);在获得第一个玩家物品之前,查看$tables的结构

例如: 替换

您可以使用print\u r($table2);在获得第一个玩家物品之前,查看$tables的结构

例如: 替换


显然,
“players”
集合中没有任何元素。该代码假定存在。因此出现了错误。
“players”
集合中显然没有任何元素。该代码假定存在。因此出现了错误。可能重复的
$table = $table2["response"]["players"][0];
print_r($table2);
print_r($table2);
$table = $table2["response"]["players"][0];