Także, chcę pobrać listę przedmiotów z kogoś ekwipunku i wyświetlić jakość (kolor) każdego przedmiotu. Mój kod, który wyświetla wszystko poza jakością:
  1. <?php
  2. function showItems($steamid)
  3. {
  4. $json_link = 'http://steamcommunity.com/profiles/'.$steamid.'/inventory/json/730/2';
  5. $json = file_get_contents($json_link);
  6. $items = json_decode($json, true);
  7.  
  8. echo '<div class="items-holder">';
  9.  
  10. foreach ($items['rgDescriptions'] as $item)
  11. {
  12. $name = $item['market_hash_name'];
  13. $name2 = str_replace(' ', '%20', $name);
  14. $link = 'https://steamcommunity.com/market/listings/730/'.$name2;
  15. $img = 'http://steamcommunity-a.akamaihd.net/economy/image/'.$item['icon_url'];
  16.  
  17. preg_match('#\((.*?)\)#', $name, $quality); // get only quality
  18.  
  19. if($item['tradable']==1 && $item['marketable']==1)
  20. {
  21. ?>
  22. <div class="item-img" style="background-image:url('<?php $img; ?>')">
  23. <img src="<?php echo $img; ?>" />
  24. <div class="item-rarity"><?php echo $quality[1]; ?></div>
  25. <div class="red"></div>
  26. </div>
  27. <?php
  28. }
  29. }
  30. echo '</div>';
  31.  
  32. }
  33. ?>


przykładowy json: http://pastebin.com/7HLjdpiR

chcę pobrać kolor, który jest w linijkach np. 1417 lub 1266. jak to zrobić?