note 88281 added to function.array-key-exists
| From: | John at osu1 dot php dot net | Date: | Mon, 19 Jan 2009 05:27:41 +0000 |
| Subject: | note 88281 added to function.array-key-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-149433@lists.php.net to get a copy of this message | ||
Here is a little function for case sensitivity to elaborate on what was said by MarkL from ##php
(Freenode) and mmanning at mdanderson dot org from this page:
// Case sensitive version of array_key_exists() using preg_match()
function array_ikey_exists($key,$arr)
{
if(preg_match("/".$key."/i", join(",", array_keys($arr))))
return true;
else
return false;
}
Not that anyone else couldn't have written this, but a concept like this strengthens
reusability. :)
----
Server IP: 209.41.74.194
Probable Submitter: 69.205.195.6
----
Manual Page -- http://www.php.net/manual/en/function.array-key-exists.php
Edit -- https://master.php.net/note/edit/88281
Del: integrated -- https://master.php.net/note/delete/88281/integrated
Del: useless -- https://master.php.net/note/delete/88281/useless
Del: bad code -- https://master.php.net/note/delete/88281/bad+code
Del: spam -- https://master.php.net/note/delete/88281/spam
Del: non-english -- https://master.php.net/note/delete/88281/non-english
Del: in docs -- https://master.php.net/note/delete/88281/in+docs
Del: other reasons-- https://master.php.net/note/delete/88281
Reject -- https://master.php.net/note/reject/88281
Search -- https://master.php.net/manage/user-notes.php