I need to merge two arrays with different depths, but with the same count. How can I distribute all of the rows from my first array to be the first row in each group of my second array?
$array1 = [
[1, 2, 3],
[1, 2, 3],
[1, 2, 3]
];
$array2 = [
[
[4, 5, 6, 7, 8],
[9, 10, 11, 12, 13],
[14, 15, 16]
],
[
[4, 5, 6, 7, 8],
[9, 10, 11, 12, 13],
[14, 15, 16]
],
[
[4, 5, 6, 7, 8],
[9, 10, 11, 12, 13],
[14, 15, 16]
]
];
Desired result:
[
[
[1, 2, 3],
[4, 5, 6, 7, 8],
[9, 10, 11, 12, 13],
[14, 15, 16]
],
[
[1, 2, 3],
[4, 5, 6, 7, 8],
[9, 10, 11, 12, 13],
[14, 15, 16]
],
[
[1, 2, 3],
[4, 5, 6, 7, 8],
[9, 10, 11, 12, 13],
[14, 15, 16]
]
]