title: PHP reading json data
body: <p>I'm new to PHP and web programming at all.I am trying to read some json data from steam API.</p>
  
  <p>Data: <a href="http://pastebin.com/hVWyLrfZ" rel="nofollow">http://pastebin.com/hVWyLrfZ</a></p>
  
  <p>I managed to get to single objects(I believe?).</p>
  
  <p>This is my code:</p>
  
  <pre><code>&lt;?php
      $url = 'https://api.steampowered.com/IEconDOTA2_570/GetHeroes/v0001/?key=X';
      $JSON = file_get_contents($url);
      $data = json_decode($JSON);
      $heroes = reset(reset($data));
  
      //var_dump($heroes);
      $wat = reset($heroes);
      $antimage = array_values($heroes)[0];
      var_dump($antimage);
  ?&gt;
  </code></pre>
  
  <p>I want data to be in array like this:</p>
  
  <pre><code>id =&gt; name
  </code></pre>
  
  <p>I mean, array keys should be ids and values should be hero names.</p>
  
  <p>Also,the where I set heroes variable to reset(<code>reset($data)</code>) seems like a bad way of doing what I want, maybe there are better ways?</p>