title: Efficient way to extract a part of multidimensional array
body: <p>I have an array which looks something like this:</p>
  
  <pre><code>$a = [
      1 =&gt; [
          'title' =&gt; 'test',
          'items' =&gt; [
              5 =&gt; [
                  'title' =&gt; 'hello',
                  'items' =&gt; []
              ]
          ]
      ],
      2 =&gt; [
          'title' =&gt; 'second',
          'items' =&gt; [
              7 =&gt; [
                  'title' =&gt; 'hello in second',
                  'items' =&gt; []
              ]
          ]
      ],
      3 =&gt; [
          'title' =&gt; 'third',
          'items' =&gt; [
              10 =&gt; [
                  'title' =&gt; 'hello in third',
                  'items' =&gt; []
              ]
          ]
      ],
  ];
  </code></pre>
  
  <p>I need a way to extract parts of it by key no matter where they are in the tree. I've tried several ways but I'm not sure how efficient they are. If it helps I need to extract only those parts which have a numeric key. Any help will be much appreciated.</p>