title: PHP array sub arrays and array_keys confusion
body: <p>I have a $menus array which contains $submenu arrays which then contain $sub_submenu arrays.</p>
  
  <p>The structure is something like this:</p>
  
  <pre><code>(
      [0] =&gt; Menu 0
          [0] =&gt; Sub Menu 0 of Menu 0
              [0] =&gt; Sub Sub Menu 0 of Sub Menu 0 of Menu 0
              [1] =&gt; Sub Sub Menu 1 of Sub Menu 0 of Menu 0
          [1] =&gt; Sub Menu 1 of Menu 0
              [0] =&gt; Sub Sub Menu 0 of Sub Menu 1 of Menu 0
              [1] =&gt; Sub Sub Menu 1 of Sub Menu 1 of Menu 0
      [1] =&gt; Menu 1
          [0] =&gt; Sub Menu 0 of Menu 1
              [0] =&gt; Sub Sub Menu 0 of Sub Menu 0 of Menu 1
              [1] =&gt; Sub Sub Menu 1 of Sub Menu 0 of Menu 1
          [1] =&gt; Sub Menu 1 of Menu 1
              [0] =&gt; Sub Sub Menu 0 of Sub Menu 1 of Menu 1
              [1] =&gt; Sub Sub Menu 1 of Sub Menu 1 of Menu 1
  )
  </code></pre>
  
  <p>if I try this:</p>
  
  <pre><code>echo $menus[$menu[1]][$submenu[0]][1];
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>Sub Sub Menu 1 of Sub Menu 0 of Menu 1
  </code></pre>
  
  <p>which is what I expect.</p>
  
  <p>I am now trying create an array which contains the values of the sub_sub_menu KEYS and I thought I could just do this:</p>
  
  <pre><code>$sub_sub_menu = array_keys($menus[$menu[1]][$submenu[0]]);
  </code></pre>
  
  <p>but I get an empty array instead:</p>
  
  <pre><code>echo '&lt;pre&gt;';print_r($sub_sub_menu); echo '&lt;/pre&gt;';
  </code></pre>
  
  <p>returns this:</p>
  
  <pre><code>    Array
  (
      [0] =&gt; 0
      [1] =&gt; 1
      [2] =&gt; 2
      [3] =&gt; 3
      [4] =&gt; 4
      [5] =&gt; 5
      [6] =&gt; 6
      [7] =&gt; 7
      [8] =&gt; 8
      [9] =&gt; 9
  )
  </code></pre>
  
  <p>What am I doing wrong?</p>