Hi,
I having problem with the function array_intersect().
I have this code that doesn't work:
$final_result1 = array_intersect($arr1, $arr2);
print_r($final_result1);
$final_result2 = array_intersect($arr3, $arr4);
print_r($final_result2);
$final_result = array_intersect($final_result1,$final_result2);
print_($final_result);
print_r($final_result1) gives:
Array ( [0] => Array ( [0] => Ms. [1] => Rachel [2] => Koh [3] => Bachelor of Information Technology [4] => 2002 [5] => rachelkoh79 ) )
print_r($final_result2) gives:
Array ( [0] => Array ( [0] => Mr. [1] => Ron [2] => Tay [3] => Bachelor of Engineering (Software) [4] => 2003 [5] => rontay79 ) )
print_($final_result) gives:
Array ( [0] => Array ( [0] => Ms. [1] => Rachel [2] => Koh [3] => Bachelor of Information Technology [4] => 2002 [5] => rachelkoh79 ) )
Why is the $final_result like this? Isn't it suppose to be an empty array?
Secondly, can it intersect more than two arrays? e.g. intersect 4 arrays array_intersect($arr1, $arr2, $arr3, $arr4).