You need at least a fixed value to identify each row, and check differences for others values.
$first = array(
"uniqueId1" => array("name" => "Ignacio", "email" => "user@server.com"),
"uniqueId2" => array("name" => "John", "email" => "jh@server.com")
);
$second = array(
"uniqueId1" => array("name" => "Ignacio", "email" => "other@server.com"),
"uniqueId2" => array("name" => "Luis", "email" => "jh@server.com")
);
And you cand compare and get differences with:
foreach($first as $keyRow => $firstRow) {
if(isset($second[$keyRow])) { //The first row exists in second array, so, I will check it
foreach($firstRow as $key => $value) {
if($second[$keyRow][$key] != $value) {
echo "For row: ".$keyRow.", ".$second[$keyRow][$key]." is not equal to: ".$value."<br />";
}
}
}
}
Output:
For row: uniqueId1, other@server.com is't equal to: user@server.com
For row: uniqueId2, Luis is't equal to: John