2
3<?
4$a = array(
5 'x' => 'x',
6 'y' => 'y',
7 'z' => 'z',
8 't' => 't',
9);
10
11$b = array(
12 'x' => 'x',
13 'y' => 'y',
14 'z' => 'z',
15 't' => 't',
16 'g' => 'g',
17);
18
19print_r(array_diff_assoc($a, $b));
20print_r(array_diff_assoc($b, $a));
21?>
22
23echoes:
24
25Array
26(
27)
28Array
29(
30 [g] => g
31)
32