I need to merge secuentially different arrays.
Let's say I have 3 and 2 arrays I need to merge all together. Currently I am using this:
$ppjson_data= json_encode(array_merge_recursive($ppposts[0][0],$ppposts[0][1],$ppposts[0][2],$ppposts[1][0],$ppposts[1][1]));
This works great.
Now the problem is that the number of arrays I may need to merge is not constant. There are $x and $y arrays to merge recursively, so how would you do it?
$x=5;
$y=10;
for ($i=0;$i<$x+1) {
for ($j=0;$j<$y+1) {
$ppjson_data=json_encode(array_merge_recursive(...));
}
}
Thank you for your help.