array_diff

It finds the difference of arrays

Example

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

Output

Array
(
[0] => VB
)

Share