The array_diff() function compares ar1 against one or more other arrays and returns the values in ar2 that are not present in any of the other arrays.
Example
<?php $array1 = array("lang" => "php", "java", ".net", "python"); $array2 = array("lang" => "perl", "java", "python"); $result = array_diff($array1, $array2); print_r($result); ?>