array_intersect < PHP
The array_intersect function returns an array containing all the values from the first array that are present in any of the other arrays.
$colors_fall = array("a"=>"red","b"=>"green","c"=>"blue","d"=>"yellow");
$colors_spring = array("e"=>"red","f"=>"green","g"=>"blue");
$colors_intersect = array_intersect($colors_fall,$colors_spring);
print_r($colors_intersect);
// Array ( [a] => red [b] => green [c] => blue )