note 108557 added to function.array-intersect
| From: | laurent at knc dot nc | Date: | Sun, 06 May 2012 23:59:30 +0000 |
| Subject: | note 108557 added to function.array-intersect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-187495@lists.php.net to get a copy of this message | ||
@dml the function works properly. Just read its usage, especially the "all the values of
array1".
So if you have an array with duplicates just do:
<?php
$array1 = array_unique($array1);
$result = array_intersect($array1, $array2);
?>
----
Server IP: 69.147.83.197
Probable Submitter: 202.22.234.238
----
Manual Page -- http://www.php.net/manual/en/function.array-intersect.php
Edit -- https://master.php.net/note/edit/108557
Del: integrated -- https://master.php.net/note/delete/108557/integrated
Del: useless -- https://master.php.net/note/delete/108557/useless
Del: bad code -- https://master.php.net/note/delete/108557/bad+code
Del: spam -- https://master.php.net/note/delete/108557/spam
Del: non-english -- https://master.php.net/note/delete/108557/non-english
Del: in docs -- https://master.php.net/note/delete/108557/in+docs
Del: other reasons-- https://master.php.net/note/delete/108557
Reject -- https://master.php.net/note/reject/108557
Search -- https://master.php.net/manage/user-notes.php