Description
array
array_diff ( array $array1, array $array2 [, array $ ...] )
Compares array1 against array2 and returns the difference.
Examples
Example 237. array_diff() example
= array("a" => "green", "red", "blue", "red");
$array2 = array("b" => "green", "yellow", "red");
$result = array_diff($array1, $array2);
print_r($result);
?>
Multiple occurrences in $array1 are all treated the same way. This will output :
Array
(
[1] => blue
)
No comments:
Post a Comment