3
I wonder if there is any native PHP function to relate all array items to all other array items, example:
$arr['a'] = [1,2,3];
$arr['b'] = [4,5];
$arr['c'] = [7,8,9,10];
To get the following result:
$result[] = [1,4,7];
$result[] = [1,4,8];
$result[] = [1,4,9];
$result[] = [1,4,10];
$result[] = [1,5,7];
$result[] = [1,5,8];
And so on, until all have related, and the initial arrays can vary in number as well as their contents.
"Recursively relate array items" - Your solution is not recursive.
– Isac
It’s not really recursive, but it’s solved for me, recurs there and glue here! vlw.
– Gabriel Selga Vital