array_diff_assoc

It computes the difference of arrays with additional index check

Example

<?php
echo “<pre>”;
$array1 = array(“a” => “PHP”, “b” => “JSP”, “c” => “ASP”, “red”);
$array2 = array(“a” => “green”, “yellow”, “red”);
$array3 = array_diff_assoc($array1, $array2);
print_r($array3);
?>

Output

Array
(
[a] => PHP
[b] => JSP
[c] => ASP
[0] => red
)