$newArray = array_values(call_user_func_array("array_intersect", $data));
array_intersect
returns the identical values of all the arrays passed, so you can pass the entries of $data
as arguments to it. array_values
is needed for reindexing as the keys won't be changed (not necessary, but helpful when you use the resulting array in a for
loop).