2 /* Prototype : array array_diff_assoc(array $arr1, array $arr2 [, array ...])
3 * Description: Returns the entries of $arr1 that have values which are not
4 * present in any of the others arguments but do additional checks whether
6 * Source code: ext/standard/array.c
10 * Test how array_diff_assoc() behaves when comparing:
11 * 1. the order of the array
13 * 3. duplicate key names
16 echo "*** Testing array_diff_assoc() : variation ***\n";
18 $array_index = array('a', 'b', 'c', 0 => 'd', 'b'); //duplicate key (0), duplicate value (b)
19 $array_assoc = array ('2' => 'c', //same key=>value pair, different order
22 'b' => '3', //key and value from array_index swapped
23 'c' => 2); //same as above, using integer
25 var_dump(array_diff_assoc($array_index, $array_assoc));
26 var_dump(array_diff_assoc($array_assoc, $array_index));