There are similar questions however none quite tackes the problem.
Array('1','2','3')
Array('4','5','6')
Assuming they both have keys 0, 1, 2. Merging the two arrays doesn’t allocate the second array values after the first’s since it overwrites keys with the same name. Neither using an union array operator (+) works. And using array_push results in this:
Array('1','2','3',Array('4','5','6'))
How can the values from array2 be added after the ones from array1 maintaining their order?
1 Answer