SyntaxFix
Write A Post
Hire A Developer
Questions
Simple, use array_intersect() instead:
array_intersect()
$result = array_intersect($array1, $array2);