title: How can I recursively get the IDs of all the parent elements in a multidimensional array?
body: <p>Let's say I have the following PHP multidimensional array, which is designed to be recursed through:</p>
  
  <pre><code>$arr = array(
    array(
      'id' =&gt; 1,
      'kids' =&gt; array(
        array(
          'id' =&gt; 11,
          'kids' =&gt; array(
            array(
              'id' =&gt; 101,
              'kids' =&gt; array(),
            ),
          ),
        ), // please note this is a sample
      ),   // it could have any number of levels
    ),
  );
  </code></pre>
  
  <p>How, given an ID value of 101, can I figure out that IDs 1 and 11 are parents of that element in the multidimensional array?</p>