Say I have two arrays:
$a = a,b,c;
$b = a,b;
When I compare this array output should be c.
Omit the common values in both array.
The quick answer:
array_merge(array_diff($a, $b), array_diff($b, $a));
array-diff($a, $b) will only extract values from $a which are not in $b.
The idea is to merge the differences.
And another way to achieve your goal might be:
function array_unique_merge() {
return array_unique(call_user_func_array('array_merge', func_get_args()));
}
array_diff