Notice: Undefined Offset: 0
<p>I am trying to get a value from an array, but when I use <code>$array[0]</code>, I get a PHP notice 'Undefined Offset: 0'. However, when I use <code>$array['id']</code> (should be the same as using '0', since 'id' is the first key in the array), I am able to get the value. I did a print_r and this was outputted:</p>

<pre><code>Array ( 
     [id] =&gt; 1 
     [username] =&gt; test 
)
</code></pre>

<p>Shouldn't I be able to get the key using its index? I believe it was working earlier, but I don't know what I could have done to make it stop working. Any ideas?</p>
