title: get min and max position in array where value exist
body: <p>I need to find the min and max position into an array where some value exist!
  use a loop inside a loop to compare values is not an option ( my array has 100.000 values )</p>
  
  <p>e.g=</p>
  
  <pre><code>$myarray[0]="red";
  $myarray[1]="red";
  $myarray[2]="blue";
  $myarray[3]="blue";
  $myarray[4]="blue";
  $myarray[5]="red";
  </code></pre>
  
  <p>how to get the min and max position where <strong>blue</strong> exist?</p>