Imagine having a few array structures (I present three, but I'd like to be as flexible as possible)
$array1 = array("red", "red", "red");
$array2 = array("green", "green", "green", "green");
$array3 = array("blue", "blue");
I need to merge these arrays together and have a structure like so:
Array
(
[0] => red
[1] => green
[2] => blue
[3] => red
[4] => green
[5] => blue
[6] => red
[7] => green
[8] => green
)
The idea is to iterate through all arrays and merge elements one by one, if any of the arrays has run out of elements, the cycle should continue as normal, I'm not sure if I'm explaining myself the best here