note 15653 added to function.array-search
| From: | mail at philipp-louis dot de | Date: | Tue, 25 Sep 2001 10:47:04 +0000 |
| Subject: | note 15653 added to function.array-search | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-18274@lists.php.net to get a copy of this message | ||
Note that the function array_search() is case-sensitive and searches for whole strings only.
Therefore, if you search the array
$haystack = array("first", "second", "third");
using
$key = array_search($needle, $haystack);
you will get a $key for
$needle = "first";
$needle = "second";
$needle = "third";
but not for
$needle = "First";
$needle = "sec";
$needle = "ird";
This is right for the function in_array() as well.
--
http://www.php.net/manual/en/function.array-search.php
http://master.php.net/manage/user-notes.php?action=edit+15653
http://master.php.net/manage/user-notes.php?action=delete+15653
http://master.php.net/manage/user-notes.php?action=reject+15653