PHP array_diff_key() Function

The two keys from the key => value pairs are considered equal only if (string) $key1 === (string) $key2 . In other words a strict type check is executed so the string representation must be the same.

The array_diff_key() function compares the keys of two (or more) arrays, and returns the differences. This function compares the keys of two (or more) arrays, and return an array that contains the entries from array1 that are not present in array2 or array3, etc.

Example -

Example -

Example -