note 35988 added to function.array-search
| From: | Cyrille at rn2 dot php dot net | Date: | Mon, 22 Sep 2003 08:07:41 +0000 |
| Subject: | note 35988 added to function.array-search | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-56880@lists.php.net to get a copy of this message | ||
You can use array_search in an uncase sensitive way :
$array = array("a", "A", "b", "hello");
$search_word = "a";
foreach($array as $key => $val) {
if (strtolower($search_word) == strtolower($val)) {
echo $val.' : '.$key.'<br>';
}
}
----
Manual Page -- http://www.php.net/manual/en/function.array-search.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35988
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35988&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35988&report=yes