title: PHP - Find parent key of array
body: <p>I'm trying to find a way to return the value of an array's parent key.</p>
  
  <p>For example, from the array below I'd like to find out the parent's key where $array['id'] == "0002".
  The parent key is obvious because it's defined here (it would be 'products'), but normally it'd be dynamic, hence the problem. The 'id' and value of 'id' is known though.</p>
  
  <pre><code>    [0] =&gt; Array
          (
              [data] =&gt; 
              [id] =&gt; 0000
              [name] =&gt; Swirl
              [categories] =&gt; Array
                  (
                      [0] =&gt; Array
                          (
                              [id] =&gt; 0001
                              [name] =&gt; Whirl
                              [products] =&gt; Array 
                                 (
                                      [0] =&gt; Array
                                          (
                                              [id] =&gt; 0002
                                              [filename] =&gt; 1.jpg
                                           )
                                      [1] =&gt; Array
                                          (
                                              [id] =&gt; 0003
                                              [filename] =&gt; 2.jpg
                                           )
                                  )
                           )
                   )
            )
  </code></pre>