【发布时间】:2015-11-09 13:04:05
【问题描述】:
我想查看站点中的用户库存。我获得了获取库存 CS:GO 的功能:
function getInventory($steamapi, $steamid, $userid) {
}
$url = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=$steamapi&steamids=$steamid";
$json_object = file_get_contents($url);
$json_decoded = json_decode($json_object);
$str = $json_decoded->response->players[0]->steamid;
$urlInv = "http://steamcommunity.com/profiles/" . $str . "/inventory/json/730/2/?trading=1";
$json_object_inv = file_get_contents($urlInv);
$json_decoded_inv = json_decode($json_object_inv, true);
$rgInventory = $json_decoded_inv[rgInventory];
$rgInventory = array_values($rgInventory);
$rgDesc = $json_decoded_inv[rgDescriptions];
$rgDesc = array_values($rgDesc);
$itemnames = array();
*******
}}
当我使用这个时,我遇到了这个问题:
警告:array_values() 期望参数 1 是数组,在第 278 行的 ***\functions.php //this 20 字符串中给出 null
警告:array_values() 期望参数 1 为数组,在第 281 行的 ***\functions.php //this 23 字符串中给出 null
这是什么?
【问题讨论】: