I am creating a faceted search, and I\'m am trying to use array_intersect
to compare the arrays and find the inputs that match.
The problem is that I wi
You can turn those array to a single array named $total_array
by using array_combine()
,
then use array_intersect($full_array, $total_array)
. I hope this useful
One can use:
$intersect = array_intersect(...$fullArray);
Try this:
$fullArray = array($array1, $array2, $array3...);
call_user_func_array('array_intersect', $fullArray);
First of all, turn those arrays into an array of arrays. Then you can use array_reduce combined with array_intersect
to reduce a variable amount of arrays down to one.