title: Parse Data from JSON URL
body: <p>I'm trying to get data onto my website by parsing data from a JSON format. The URL is <a href="http://api.bfhstats.com/api/onlinePlayers" rel="nofollow">http://api.bfhstats.com/api/onlinePlayers</a> and I'm trying to output for example the currently players online on PC. </p>
  
  <p>Here's the current code I have:</p>
  
  <pre><code>&lt;?$json = file_get_contents("http://api.bfhstats.com/api/onlinePlayers");
  $data = json_decode($jsondata, true);
  echo $data-&gt;pc-&gt;peak24;?&gt;
  </code></pre>
  
  <p>I thought this would work, however it's not displaying anything. I am very new to parsing JSON data so if someone could explain what I'm doing wrong that would be brilliant.</p>