I\'m trying to intersect an arbitrary number of PHP arrays, the count of which depends on a user provided parameter, each of which can have any number of elements.
F
Don't use eval()!
Try this
$isect = array(); for ($i = 1; $i <= $N; $i++) { $isect = array_intersect($isect, ${'array'.$i}); }
or that
$arrays = array() for ($i = 1; $i <= $N; $i++) { $arrays[] = ${'array'.$i}; } $isect = call_user_func_array('array_intersect', $arrays);