title: Array_slice in multidimensional array? But a different output
body: <p>I have an array in php like this :</p>
  
  <pre><code>     $multid_array = array(
          "url" =&gt; "www.checkmyhouse.cpm",
          "date" =&gt; "2019/12/12",
          "minor" =&gt; 1,
          "sittingroom" =&gt; 1,
          "dinningroom" =&gt; 2,
          "toilet" =&gt; 2,
          "parking" =&gt; 1,
          "bedroom" =&gt; 2,
          "garage" =&gt; 2,
          "rooms" =&gt; 4,
          "garden" =&gt; 1,
  
          "url_1" =&gt; "-sameurl-",
          "date_1" =&gt; "2019/12/3",
          "minor_1" =&gt; 3,
          "sittingroom_1" =&gt; 2,
          "dinningroom_1" =&gt; 2,
          "toilet_1" =&gt; 3,
          "parking_1" =&gt; 1,
          "bedroom_1" =&gt; 2,
          "garage_1" =&gt; 6,
          "rooms_1" =&gt; 6,
          "garden_1" =&gt; 1,
  
          "url_2" =&gt; "-sameurl-",
          "date_2" =&gt; "2019/12/5",
          "minor_2" =&gt; 3,
          "sittingroom_2" =&gt; 2,
          "dinningroom_2" =&gt; 2,
          "toilet_2" =&gt; 3,
          "parking_2" =&gt; 1,
          "bedroom_2" =&gt; 5,
          "garage_2" =&gt; 6,
          "rooms_2" =&gt; 9,
          "garden_2" =&gt; 1,
      );
  </code></pre>
  
  <p>I have searched around, found this link. but not been able to figure it out. keep getting close. 
  <a href="https://stackoverflow.com/questions/3837236/array-slice-in-multidimensional-array">array_slice in multidimensional array?</a></p>
  
  <p>This is the output I would like:</p>
  
  <pre><code>$array =
      [ 
         "levels" =&gt; array(
              "0" =&gt; array(
                  "url" =&gt; "www.checkmyhouse.cpm",
                  "date" =&gt; "2019/12/1",
                  "minor" =&gt; 1,
                  "sittingroom" =&gt; 1,
                  "dinningroom" =&gt; 2,
                  "toilet" =&gt; 2,
                  "parking" =&gt; 1,
                  "bedroom" =&gt; 2,
                  "garage" =&gt; 2,
                  "rooms" =&gt; 5,
                  "garden" =&gt; 1,
              ),
              "1" =&gt; array(
                  "url" =&gt; "-sameurl-",
                  "date" =&gt; "2019/12/3",
                  "minor" =&gt; 3,
                  "sittingroom" =&gt; 2,
                  "dinningroom" =&gt; 2,
                  "toilet" =&gt; 3,
                  "parking" =&gt; 1,
                  "bedroom" =&gt; 2,
                  "garage" =&gt; 6,
                  "rooms" =&gt; 6,
                  "garden" =&gt; 1,
              ),
              "2" =&gt; array(
                  "url" =&gt; "-sameurl-",
                  "date" =&gt; "2019/12/5",
                  "minor" =&gt; 3,
                  "sittingroom" =&gt; 2,
                  "dinningroom" =&gt; 2,
                  "toilet" =&gt; 3,
                  "parking" =&gt; 1,
                  "bedroom" =&gt; 5,
                  "garage" =&gt; 6,
                  "rooms" =&gt; 9,
                  "garden" =&gt; 1,
              )
          )
      ];
  </code></pre>
  
  <p>Just trying to rearrange it. but I have used array_slice and could only get the output of the first 9 elements.</p>
  
  <pre><code>array_splice($multid_array,9);
  </code></pre>
  
  <p>But I want to run it automatically, so in case more information gets added into the array then it would still work</p>