remove an element from an array if it's present inside another code example Example: remove item from array if exists in another array $filteredFoo = array_diff($foo, $bar);