-2
我想查看網站中用戶的庫存。我真的得到函數拿到盤點CS:GO:獲取Steam庫存
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();
*******
}}
當我使用這個,我有這樣的煩惱:
Warning: array_values() expects parameter 1 to be array, null given in ***\functions.php on line 278 //this 20 string Warning: array_values() expects parameter 1 to be array, null given in ***\functions.php on line 281 //this 23 string
這是什麼? 謝謝你。