PHP array_intersect_key() Function
What is array_intersect_key() Function?
The "array_intersect_key()" function is used to compute the intersection of array elements, only if the keys are present in all other arrays.
In the above syntax keys of "array1" is compared with other array elements, to return an array with values of keys that are present in all other arrays.
$a = array (0=>'Blue',1=>'Green', 2=>'Orange', 3=>'Pink');
$b = array (4=>'Red', 2=>'Green', 3=>'Orange');
Array (  => Orange  => Pink )
In the above example the two arrays "$a","$b" when compared for keys, returns "Orange","Pink", as the keys 3,2 are present in both the arrays.