How else might you compare two arrays ($A and $B )and reduce matching elements out of the first to prep for the next loop over the array $A?
$A = array(1,2,3
Try to this
$a = array(0=>'a',1=>'x',2=>'c',3=>'y',4=>'w'); $b = array(1=>'a',6=>'b',2=>'y',3=>'z'); $c = array_intersect($a, $b); $result = array_diff($a, $c); print_r($result);