Get the index value of an array in php
<p>I have an array:</p>

<pre><code>$list = array('string1', 'string2', 'string3');
</code></pre>

<p>I want to get the index for a given value (i.e. <code>1</code> for <code>string2</code> and <code>2</code> for <code>string3</code>)</p>

<p>All I want is the position of the strings in the array</p>

<ul>
<li>string1 is 0</li>
<li>string2 is 1</li>
<li>string3 is 2</li>
</ul>

<p>How to get this? I tried <code>array_search</code> but it was no use</p>
