creating new array from multidimensional arrays -next step

Viewed 38

I searched all options for it, without success.

I have my Multidimensional Array like this:

Array 
(
[0] => Array
    (
        [0] => "Title1" 
        [1] => "Title2"
        [2] => "Title3"
    )
[1] => Array
    (
        [0] => "Title1"  
        [1] => "Title2"
    )
)
 Array #2

  Array
   (
[0] => Array
    (
        [0] => "Value1"  
        [1] => "Value2"
        [2] => "Value3"
    )
[1] => Array
    (
        [0] => "Value" 
        [1] => "Value2"
    )
)

And I would like to achive result like this:

New Array

Array
(
[0] => Array
    (
      [0] =>Array
          (
        [0] => "Title1"  
        [1] => "Title2"
        [2] => "Title3"
          )
          (
      [1] =>Array
          (
        [0] => "Title1"  
        [1] => "Title2"
          )
 )
 (

[1] => Array
    (
      [0] =>Array
          (
        [0] => "Value1"  
        [1] => "Value2"
        [2] => "Value3"
          )
          (
      [1] =>Array
          (
        [0] => "Value"  
        [1] => "Value2"
          )
    )
)

So I want to add 1 level of array, My thinking way is to loop through multidimensional array(2 loops) and by 3 loop add 2 next(on this example) array within. array_merge_recursive will not work. I tried to create proper loop, but without success. Is it possible??

3 Answers
Related