note 101613 modified in function.array-diff by danbrown
| From: | danbrown@php.net | Date: | Thu, 30 Dec 2010 16:07:21 +0000 |
| Subject: | note 101613 modified in function.array-diff by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-175336@lists.php.net to get a copy of this message | ||
Note that array_diff is not equivalent to
<?php
function fullArrayDiff($left, $right)
{
return array_diff(array_merge($left, $right), array_intersect($left, $right));
}
?>
since it is a set-theoretical complement as in
http://en.wikipedia.org/wiki/Complement_(set_theory)
--was--
Note that array_diff is not equivalent to
function fullArrayDiff($left, $right)
{
return array_diff(array_merge($left, $right), array_intersect($left, $right));
}
since it is a set-theoretical complement as in
http://en.wikipedia.org/wiki/Complement_(set_theory)
http://php.net/manual/en/function.array-diff.php