Compare the keys of three arrays, and return the differences in PHP
Description
The following code shows how to compare the keys of three arrays, and return the differences.
Example
//from w w w. j ava2 s .c o m
<?php
$a1=array("a"=>"red","b"=>"green","c"=>"blue");
$a2=array("c"=>"yellow","d"=>"black","e"=>"brown");
$a3=array("f"=>"green","c"=>"purple","g"=>"red");
$result=array_diff_key($a1,$a2,$a3);
print_r($result);
?>
The code above generates the following result.