I am trying to get the difference between three arrays
array_diff()
function doesn't help because it matches only the first array with others
For example I want to compare three arrays and each array has one of the element different from each other like this
$a1=array("a"=>"red","b"=>"green","c"=>"blue", 'v1' => 'sss');
$a2=array("e"=>"red","f"=>"green","g"=>"blue", 'v2' => 'ss');
$a3=array("e"=>"red","f"=>"green","g"=>"blue", 'v3' => 's');
when I use array_diff()
on these arrays it would just show me the unique value out of other two arrays
$res = array_diff($a1, $a2, $a3);
print_r($res);
It's result would be Array ( [v1] => sss )
While I want it to tell me the unique values in all these arrays like this Array ( [v1] => sss [v2] => ss [v3] => s )
I tried other array comparison functions but couldn't find one to compare all given array to each other instead of comparing just one array to others