title: Finding a specific key in an php array
body: <p>I have some troubles finding the right key in an array:</p>
  
  <p>when I have an array: $haystack</p>
  
  <pre><code>$haystack = array(0 =&gt; 'apple', 
                    1 =&gt; 'apple', 
                    2 =&gt; 'pear', 
                    3 =&gt; 'apple', 
                    4 =&gt; 'banana');
  </code></pre>
  
  <p>and is use the function array_search</p>
  
  <pre><code>$key = array_search('apple', $haystack);
  </code></pre>
  
  <p>the function wil set the $key value to '0' ( $key = 0 )</p>
  
  <p>I need to find the key of the fourth item in the array (3) which is also apple...
  Does anyone know a function that searches the array from a given index and returns a value?</p>
  
  <p>for example something like: </p>
  
  <pre><code>array_search_start($needle, $haystack, $startPosition);
  </code></pre>