- array_intersect: documentation ( source)
- print_r: documentation ( source)
<?php
$array1 = array(1 => "green", 2 => "red", 4=> 'yellow');
$array2 = array(1=>'roxo', 2 => "green", 3 => "yellow", 4=>'blue', 5=> "red");
$result = array_intersect($array1, $array2);
print_r($result);