title: Testing for a result from array_search
body: <p>I am processing a CSV authored by a remote system.  I don't want to assume they won't change what fields they provide or their order so I am parsing a header row for the indices in the CSV of fields and mapping these into an array I can use for lookups and updates.</p>
  
  <p>Thing is the way I am doing it tests false for index zero:</p>
  
  <pre><code>foreach ($field_map_array as $local_field =&gt; $silverpop_field) {
      if ($idx = array_search($silverpop_field, $fields)) {
          $local_to_sp[$local_table][$local_field] = $idx;
      } // index found
  }
  </code></pre>
  
  <p>What's a better way to do that?</p>