note 118445 added to function.array-intersect
| From: | juniorand at gmail dot com | Date: | Mon, 07 Dec 2015 13:19:41 +0000 |
| Subject: | note 118445 added to function.array-intersect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-204301@lists.php.net to get a copy of this message | ||
If you just need confirmation that there intersection (and will not use the return of the
intersection). Just only returns a boolean.
<?php
function eventsCodeIntersect()
{
$eventsCod = array(211, 220, 244);
$eventsIntersect = array(220, 244);
return (bool) array_intersect($array1, $array2);
}
?>
In this case, the return is true.
----
Server IP: 72.52.91.14
Probable Submitter: 187.33.233.50
----
Manual Page -- http://php.net/manual/en/function.array-intersect.php
Edit -- https://master.php.net/note/edit/118445
Del: integrated -- https://master.php.net/note/delete/118445/integrated
Del: useless -- https://master.php.net/note/delete/118445/useless
Del: bad code -- https://master.php.net/note/delete/118445/bad+code
Del: spam -- https://master.php.net/note/delete/118445/spam
Del: non-english -- https://master.php.net/note/delete/118445/non-english
Del: in docs -- https://master.php.net/note/delete/118445/in+docs
Del: other reasons-- https://master.php.net/note/delete/118445
Reject -- https://master.php.net/note/reject/118445
Search -- https://master.php.net/manage/user-notes.php