To get the difference between the two arrays you need to do the following:
$fullDiff = array_merge(array_diff($array1, $array2), array_diff($array2, $array1));
The reason being that array_diff()
will only give you the values that are in $array1
but not $array2
, not the other way around. The above will give you both.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…