php - Code to getting through two arrays is not working -
so code:
<?php $apikey = "x"; $steamid = $steamprofile['steamid']; $url_inv = "http://api.steampowered.com/ieconitems_730/getplayeritems/v0001/?language=en?key=". $apikey . "&steamid=" . $steamid . "&format=json"; $url_schema = "http://git.optf2.com/schema-tracking/plain/counter%20strike%20global%20offensive%20schema?h=counterstrikeglobaloffensive"; $array_inv_raw = file_get_contents($url_inv); $array_schema_raw = file_get_contents($url_schema); $array_inv = json_decode($array_inv_raw,true); $array_schema = json_decode($array_schema_raw,true); foreach($array_inv['result']['items'] $item){ foreach($array_schema['result']['items'] $schemaitem){ if($item['defindex'] == $schemaitem['defindex']){ echo $schemaitem['item_name'].'<br />'; break; } } } ?>
it should convert "defindex" array_inv "item_name" array_schema. i'm getting these errors:
warning: file_get_contents(http://api.steampowered.com/ieconitems_730/getplayeritems/v0001/?language=en?key=x&steamid=76561198037897388&format=json): failed open stream: http request failed! http/1.1 403 forbidden in /home/kartm/public_html/scripts/inv.php on line 6
warning: invalid argument supplied foreach() in /home/kartm/public_html/scripts/inv.php on line 12
in opinion code correct, don't know doing wrong. can tell me what's wrong code?
Comments
Post a Comment