title: php array shift keys multidimensional array
body: <p>I have an array like this. </p>
  
  <pre><code>$array = array ( '18' =&gt; array (  '1' =&gt;'', '14' =&gt;''),
                   '23' =&gt; array ( '24' =&gt;''), 
                   '24' =&gt; array ( '25' =&gt;'', '26' =&gt;''),
                   '26' =&gt; array ( '27' =&gt;'', '28' =&gt;''), 
                   '30' =&gt; array ( '23' =&gt;'', '31' =&gt;'')
                  );
  </code></pre>
  
  <p>I wanna this array to rearrange like this.</p>
  
  <pre><code> Array 
  (
  [18] =&gt; Array
      (
      [1] =&gt;
      [14] =&gt;
      )
  [30] =&gt; Array
      (
      [23] =&gt; Array
         ( 
          [24] =&gt; Array
             ( 
              [25] =&gt;
              [26] =&gt; Array
                 ( 
                  [27] =&gt;
                  [28] =&gt;
                 )
             )
        )
     )
  )
  </code></pre>
  
  <p>I appreciate someone's help.</p>