So, for example, if these were your arrays:
$arr_1 = array ("applae", "banana", "carrot", "water_lemon");
$arr_2 = array("carrot", "banana", "cheese");
and this is what you wanted:
$arr_3 = array("carrot", "banana");
then I would again reiterate what Installer has said above:
$arr_3 = array_intersect($arr_2, $arr_1);