Get index of element in an array by the value
<p>I have this array in PHP:</p>

<pre><code>array(
    [0] =&gt; array( 'username' =&gt; 'user1' )
    [1] =&gt; array( 'username' =&gt; 'user2' )
)
</code></pre>

<p>If I have the 'username' string how can I get the index value as a number?</p>

<p>Example, if I have 'user1' how can I get 0?</p>
