PHP array_intersect_key() Function

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

Example -

PHP array_intersect_key() function returns an array that contains the entries from array1 that are present in array2, array3, etc.

Example -