I have been trying to find the answer to this one with no luck, so if anyone can help I would really appreciate it. is there a function in PHP which can compare 2 arrays and place matching values in a 3rd array? Also I wonder how I could determine if there were any matches or not, like a boolean.
$array1 = array (1,2,3,4);
$array2 = array (1, 2, 7,8);
//I want to have an array like $array3 after comparing $array1
//and $array2.....also I want to know if values were placed in
//$array3 or not.
$array3 = array(1,2);