I need to compare all first levels items of a muli-dimensional array and get the intersection values.. But the array doesn't have a fixed number arrays to compare with each other..
Here you have to explicit type each argument in array_intersect
..
$list = [
[0,1,2],
[2,5],
[-1,2]
];
$t = array_intersect($list[0], $list[1], $list[2]);
print_r($t);
But what if the $list
array had 10 sub-arrays and I wanted to compare each and one of them?