title: Search for values in nested array
body: <p>I have an array as follows</p>
  
  <pre><code>array(2) {
    ["operator"] =&gt; array(2) {
      ["qty"] =&gt; int(2)
      ["id"] =&gt; int(251)
    }
    ["accessory209"] =&gt; array(2) {
      ["qty"] =&gt; int(1)
      ["id"] =&gt; int(209)
    }
    ["accessory211"] =&gt; array(2) {
      ["qty"] =&gt; int(1)
      ["id"] =&gt; int(211)
    }
  }
  </code></pre>
  
  <p>I'm trying to find a way to verify an id value exists within the array and return bool. I'm trying to figure out a quick way that doesn't require creating a loop. Using the in_array function did not work, and I also read that it is quite slow.</p>
  
  <p>In the php manual someone recommended using flip_array() and then isset(), but I can't get it to work for a 2-d array. </p>
  
  <p>doing something like</p>
  
  <pre><code>if($array['accessory']['id'] == 211)
  </code></pre>
  
  <p>would also work for me, but I need to match all keys containing accessory -- not sure how to do that</p>
  
  <p>Anyways, I'm spinning in circles, and could use some help. 
  This seems like it should be easy.  Thanks.</p>