Last updated on August 24, 2015
$v) { foreach ($arrayb as $k2 => $v2) { if($v == $v2) { unset($array[$k],$arrayb[$k2]); // removed matched items } } } } compare($array,$arrayb); // delete all print_r($array); echo '============'; // insert all print_r($arrayb);