Return a subset of the array by passing in an array of keys to discard
array_except(array $array, array $keys): array
array
The input array
keys
The keys to remove from the result
Returns a copy of the array with the keys removed.
Example # 1 Example uses of array_except()
print_r(
array_except([
'a' => 1,
'b' => 2
], ['a'])
);
The above example will output:
Array
(
[b] => 2
)