I looked for all the options for him, without success.
I have a multidimensional array like this:
Array
(
[0] => Array
(
[0] => "Title1"
[1] => "Title2"
[2] => "Title3"
)
[1] => Array
(
[0] => "Title1"
[1] => "Title2"
)
)
Array
Array
(
[0] => Array
(
[0] => "Value1"
[1] => "Value2"
[2] => "Value3"
)
[1] => Array
(
[0] => "Value"
[1] => "Value2"
)
)
And I would like to achieve this result:
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 array. My way of thinking is to loop through a multidimensional array (2 loops) and add 3 of the next (in this example) array inside 3 loops. array_merge_recursive will not work. I tried to create the correct loop, but to no avail. Is it possible?
source
share