I have some unknown number of iterations in which every iteration gives two arrays.
for ($i = 0; $i<sizeof($foo); $i++) {
$array1 = //do something
$array2 = //do something
$result = //($result + $array1 + $array2)
}
What I want to do is to append the elements of those arrays to $result.
If I use array_merge() I cannot add the previous elements of $result to it.
If I use array_push() I will get a 2D array which I don't want.
array_push($result, $array1, $array2);
So what is the best solution to my problem? Is there any way to do it without iterating through each array and pushing every element?