note 85068 added to function.array-intersect
| From: | Esfandiar--e dot bandariatgmaildotcom at osu1 dot php dot net | Date: | Wed, 13 Aug 2008 16:19:27 +0000 |
| Subject: | note 85068 added to function.array-intersect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-143449@lists.php.net to get a copy of this message | ||
Php should have this, but I couldn't find a function that would find and return the index of
value(s) in an array. So here is:
function arrayFindValues ($array2search, $values) {
// array intersect needs $values to be an array
$tmp = is_array($values) ? $values : array($values);
return array_intersect ($array2search, $tmp);
}
----
Server IP: 64.71.164.2
Probable Submitter: 76.200.152.26
----
Manual Page -- http://www.php.net/manual/en/function.array-intersect.php
Edit -- https://master.php.net/note/edit/85068
Del: integrated -- https://master.php.net/note/delete/85068/integrated
Del: useless -- https://master.php.net/note/delete/85068/useless
Del: bad code -- https://master.php.net/note/delete/85068/bad+code
Del: spam -- https://master.php.net/note/delete/85068/spam
Del: non-english -- https://master.php.net/note/delete/85068/non-english
Del: in docs -- https://master.php.net/note/delete/85068/in+docs
Del: other reasons-- https://master.php.net/note/delete/85068
Reject -- https://master.php.net/note/reject/85068
Search -- https://master.php.net/manage/user-notes.php