note 106449 added to function.array-key-exists
| From: | Rudi at osu1 dot php dot net | Date: | Thu, 10 Nov 2011 10:10:45 +0000 |
| Subject: | note 106449 added to function.array-key-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184369@lists.php.net to get a copy of this message | ||
I've got a new take on the multi key function I would like to share.
<?php
function array_multi_key_exists(array $arrNeedles, array $arrHaystack, $blnMatchAll=true){
$blnFound = array_key_exists(array_shift($arrNeedles), $arrHaystack);
if($blnFound && (count($arrNeedles) == 0 || !$blnMatchAll))
return true;
if(!$blnFound && count($arrNeedles) == 0 || $blnMatchAll)
return false;
return array_multi_key_exists($arrNeedles, $arrHaystack, $blnMatchAll);
}
?>
Hope you'll find it usefull.
----
Server IP: 69.147.83.197
Probable Submitter: 83.167.195.14
----
Manual Page -- http://www.php.net/manual/en/function.array-key-exists.php
Edit -- https://master.php.net/note/edit/106449
Del: integrated -- https://master.php.net/note/delete/106449/integrated
Del: useless -- https://master.php.net/note/delete/106449/useless
Del: bad code -- https://master.php.net/note/delete/106449/bad+code
Del: spam -- https://master.php.net/note/delete/106449/spam
Del: non-english -- https://master.php.net/note/delete/106449/non-english
Del: in docs -- https://master.php.net/note/delete/106449/in+docs
Del: other reasons-- https://master.php.net/note/delete/106449
Reject -- https://master.php.net/note/reject/106449
Search -- https://master.php.net/manage/user-notes.php