title: lookup function in PHP
body: <p>Is there any built in function to enable the lookup function in PHP like the excel one? I thought the array_search would be the closest one, but it won't work if the mixed needle(value) has more than one values. To illustrate, the lookup I try to perform is:</p>
  
  <pre><code>function lookup($datatype){
      $array = array(
          'BINARY' =&gt; 'RAW',
          'REAL' =&gt; 'FLOAT',
          'INTEGER' =&gt; 'NUMBER',
          'DATETIME' =&gt; 'DATE', 
          'VARCHAR' =&gt; 'VARCHAR2',
          'DATETIME' =&gt; 'TIMESTAMP',
          'VARBINARY' =&gt; 'BFILE',
          'INT' =&gt; 'NUMERIC'
          );
  
      $key = array_search($datatype, $array);
  
      return $key;
  }
  </code></pre>
  
  <p>If the lookup is for the 'RAW', array_search will return 'BINARY', but when the lookup is 'DATE', it won't return anything.</p>
  
  <p>Any thoughts would be much appreciated.</p>