if one array value match another array then remove it code example Example: remove item from array if exists in another array $filteredFoo = array_diff($foo, $bar);