laserlight;10901637 wrote:You can use either, and if your algorithm is correct, it will work, otherwise it won't 😉
I am still not clear on whether the number of inner arrays is fixed. If it is not, then you need to accomodate that fact.
i try to better explain the problem
if i know that the parent array is size = 3
i can do:
for($a = 0; $a<sizeof($parentarray[0]);$a++)
for($b = 0; $b<sizeof($parentarray[1]);$b++)
for($c = 0; $c<sizeof($parentarray[2]);$c++)
echo
$parentarray[0][$a] .
$parentarray[1][$b] .
$parentarray[2][$c];
but i don't know the size of the parent array
so i cant do:
for size==3:
for()for()for(){}
because the size can be 4 too:
for()for()for()for(){}
or 5:
for()for()for()for()for(){}
etc.
bye