title: Array search not working as expected
body: <p>I am trying to replace the value <strong>Event Id</strong> in the <code>$fields</code> array with the value that is mapped to (<strong>idEvent</strong>) in the <code>$aliases</code> array, but PHP's <code>array_search</code> function is returning the wrong position. Note: I am converting the values to all lower case so it should return a match, and it seems like <code>array_search</code> is returning a index, but it should be returning index <code>2</code> instead of index <code>1</code> since it is the third value in the <code>$fields</code> array. </p>
  
  <p>Unfortunately, if you run the code (e.g. copy and paste it here: <a href="http://writecodeonline.com/php/" rel="nofollow">http://writecodeonline.com/php/</a>), it returns the wrong value. Could someone please tell me if I am doing something wrong?</p>
  
  <pre><code>$fields = array('Host', 'OS', 'Event Id');
  $aliases = array('idEvent' =&gt; 'Event ID');
  
   foreach ($aliases as $actual =&gt; $alias){
  
      $alias = strtolower($alias);
  
      echo "searching fields(" . implode(',', array_map('strtolower', $fields)) . ") for $alias&lt;br/&gt;";
      if ($position = array_search($alias, array_map('strtolower', $fields)) !== FALSE) {
  
          echo "$alias was found at \$fields[$position]";
          $fields[$position] = $actual;
  
      }
  }
  </code></pre>
  
  <p>Edit: I added some echo statements so you can what I am trying to do.</p>