foreach($menuxml as $k1 => $v1) { foreach($menufile as $k2 => $v2) { if ($v1 = $v2) { unset($menuxml[$k1]); } } }