Skip to content
Advertisement

php how to implode two dimensional array as arguments of array_intersect

I have an array of arrays like below

JavaScript

and I want to give them as arguments of array_intersect like below

JavaScript

but this is not dynamic do you have better suggestions?

Advertisement

Answer

You can use call_user_func_array like this

$intersect = call_user_func_array('array_intersect',$array);

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement