array_diff

Syntax:array array_diff_assoc ( array $array1 , array $array2 [, array $… ] )

Description:Computes the difference of arrays with additional index check

<?php
$array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red");
$array2 = array("a" => "green", "yellow", "red");
$result = array_diff_assoc($array1, $array2);
print_r($result);
?>

OUTPUT

Array ( 
[b] => brown 
[\c] => blue 
[0] => red )