Get status of CS's JSON item: GO

-4

Well it's the following I have the following code that causes it to take all the items / weapons from the inventory of a certain individual and shows it.

Well what I wanted to know is how do I get past the items to tell the status of the item, type:

Sawed-Off | Full Stop (Field-Tested)

My Code:

<?php
$steamid = '76561198103888786';

$destUrl = 'http://steamcommunity.com/profiles/' . $steamid . '/inventory/json/730/2/';

$data = file_get_contents($destUrl, false);
$data = json_decode($data, true);
$data1= array_keys($data['rgDescriptions']);
$data2= $data['rgDescriptions'];
for($i = 0; $i < count($data1); ++$i) {
    $items =  $data2[$data1[$i]]['name'];
        echo $items;
        echo "<br>";
}
?>
    
asked by anonymous 15.02.2016 / 03:55

1 answer

1

The example mentioned item in question is 310778159_302028390 .

In this way, you should only get market_hash_name or market_name instead of name .

In this case just insert:

for($i = 0; $i < count($data1); ++$i) {

    echo '<br> ID: '. $data1[$i];
    echo '<br> Name: '. $data2[$data1[$i]]['name'];
    echo '<br> Market_Hash_Name: '. $data2[$data1[$i]]['market_hash_name'];
    echo '<br> Market_Name: '. $data2[$data1[$i]]['market_name'];
    echo '<br>';

}

With this you will get and display all data, both the market_* and the name .

    
16.02.2016 / 16:05