title: Recursive multidimensional array search but exclude a certain sub-array?
body: <p>I have the following code. Basically I want to search through the keys of this multidimensional array from top to bottom, but ignore the sub-array with the key specified by <code>$ignoreKey</code>. As you can see by the <code>"array_key_exists"</code> logic, it is currently built for a 1D array.. I tried some examples but having problems (so have left my 1D code as is below).</p>
  
  <p>If all went as planned, I would have <code>"thirtyfromgroup1"</code> echoed.</p>
  
  <p>What would I have to change in the following to achieve this? </p>
  
  <pre><code>$keyCheck = "30";
  $ignoreKey = "group2";
  
  if (array_key_exists($keyCheck, $topLevel)) {
        echo $topLevel[$keyCheck];
  }
  
   $topLevel = array( 
             "group1" =&gt; array
                                 (
                                 "12" =&gt; "twelve", 
                                 "30" =&gt; "thirtyfromgroup1" 
                                 ),
              "group2" =&gt; array
                                 (
                                 "14" =&gt; "fourteen", 
                                 "30" =&gt; "thirty" 
                                  ),
               "group3" =&gt; array
                                 (
                                 "12" =&gt; "twelve", 
                                 "26" =&gt; "thirty" 
                                  ),
                     );
  </code></pre>