TwitchTV Undefined offset
<p>So I have read all up on the TwitchTV API, searched all of the net for a answer, tried multiple codes, and I still can't get this to work.</p>

<p>What is happening is when the stream in the $channel variable in not online, the page ALWAYS returns a error of </p>

<blockquote>
  <p>Notice: Undefined offset: 0 in
  /home/user/public_html/livestreamstatus.php on line 13</p>
</blockquote>

<p>. I need to know how to get rid of this and just display the word "OFFLINE"</p>

<p>Here is the code:</p>

<pre><code>&lt;?php

    $channel = "gamespot";

    $json_file = @file_get_contents("http://api.justin.tv/api/stream/list.json?channel={$channel}", 0, null, null);
    $json_array = json_decode($json_file, true);

    if ($json_array[0]['name'] == "live_user_{$channel}") {
        $channelTitle = $json_array[0]['channel']['title'];
        $title = $json_array[0]['channel']['status'];

?&gt;
    ONLINE
&lt;br /&gt;

&lt;?php

    } else {

?&gt;
    OFFLINE
&lt;?php

    }

?&gt;
</code></pre>
