Retrieving Json data from external URL
<p>I'm having a hard time getting some json data from an API here. Basically I want to get the file contents, then assign the "meta_game" to a variable and I also want the "channel_count" to be assigned to a variable. As you can see here, I tried 2 different methods for both instances and neither work at the moment.     </p>

<pre><code>$json = file_get_contents($chan);
$json_data = unserialize($json);
$gameName = json_decode($json)-&gt;meta_game;
$viewerCount = $json_data['channel_count'];
</code></pre>

<p>Heres an example of a URL it would be taking this from: <a href="http://api.justin.tv/api/stream/list.json?channel=" rel="nofollow">http://api.justin.tv/api/stream/list.json?channel=</a> + channel name.</p>
