2 /* Prototype : array array_intersect_key(array arr1, array arr2 [, array ...])
3 * Description: Returns the entries of arr1 that have keys which are present in all the other arguments.
4 * Source code: ext/standard/array.c
7 echo "*** Testing array_intersect_key() : usage variation ***\n";
9 /// Initialise function arguments not being substituted (if any)
12 'first' => array('blue' => 1, 'red' => 2),
14 'second' => array('yellow' => 7),
16 'third' => array(0 =>'zero'),
21 'first' => array('blue' => 1, 'red' => 2,),
23 'second' => array('cyan' => 8),
25 'fourth' => array(2 => 'two'),
27 var_dump( array_intersect_key($array1, $array2) );
28 var_dump( array_intersect_key($array2,$array1 ) );