I have 2 arrays:
$array1 = array("1","2","3","4","5");
$array2 = array("7","2","3","1","5");
What I want to do is match the values in $array1 and $array2 strictly in order.
The desired output should be 2, 3 and 5 since 1 is not in the same order. I've tried array_intersect but it only matches array values and not taking account their order.
Thanks in advance.
You can use
array_intersect_assocas below: