note 70754 added to function.in-array
| From: | mattsch at gmail dot com | Date: | Thu, 26 Oct 2006 16:04:42 +0000 |
| Subject: | note 70754 added to function.in-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-119139@lists.php.net to get a copy of this message | ||
I'm not sure why you would do a loop for a function that needs to be fast. There's an
easier way:
function preg_array($strPattern, $arrInput){
$arrReturn = preg_grep($strPattern, $arrInput);
return (count($arrReturn)) ? true : false;
}
----
Server IP: 216.194.113.175
Probable Submitter: 72.48.97.42
----
Manual Page -- http://www.php.net/manual/en/function.in-array.php
Edit -- https://master.php.net/note/edit/70754
Del: integrated -- https://master.php.net/note/delete/70754/integrated
Del: useless -- https://master.php.net/note/delete/70754/useless
Del: bad code -- https://master.php.net/note/delete/70754/bad+code
Del: spam -- https://master.php.net/note/delete/70754/spam
Del: non-english -- https://master.php.net/note/delete/70754/non-english
Del: in docs -- https://master.php.net/note/delete/70754/in+docs
Del: other reasons-- https://master.php.net/note/delete/70754
Reject -- https://master.php.net/note/reject/70754
Search -- https://master.php.net/manage/user-notes.php