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)
10 $input_array = array(0 => '0', -1 => '-1' , 02 => 'two', -07 => '-07', 0xA => '0xA', -0xC => '-0xc');
12 $input_arrays = array(
13 'decimal indexed' => array(10 => '10', '-17' => '-17'),
14 'octal indexed' => array(-011 => '-011', 012 => '012'),
15 'hexa indexed' => array(0x12 => '0x12', -0x7 => '-0x7', ),
18 foreach($input_arrays as $key =>$value) {
20 var_dump( array_intersect_key($input_array, $value) );
21 var_dump( array_intersect_key($value,$input_array ) );