title: PHP Search an Array for multiple key / value pairs
body: <p>I have a array list (for this example I'm using cell phones). I'm wanting to be able to search for multiple key/value pairs and return it's parent array index.</p>
  
  <p>For example, here is my array:</p>
  
  <pre><code>// $list_of_phones (array)
  Array
  (
      [0] =&gt; Array
          (
              [Manufacturer] =&gt; Apple
              [Model] =&gt; iPhone 3G 8GB
              [Carrier] =&gt; AT&amp;T
          )
  
      [1] =&gt; Array
          (
              [Manufacturer] =&gt; Motorola
              [Model] =&gt; Droid X2
              [Carrier] =&gt; Verizon
          )
  )
  </code></pre>
  
  <p>I'm wanting to be able to do something like the following:</p>
  
  <pre><code>// This is not a real function, just used for example purposes
  $phone_id = multi_array_search( array('Manufacturer' =&gt; 'Motorola', 'Model' =&gt; 'Droid X2'), $list_of_phones );
  
  // $phone_id should return '1', as this is the index of the result.
  </code></pre>
  
  <p>Any ideas or suggestions on how I can or should do this?</p>