note 15653 deleted from function.array-search by jimw
| From: | jimw@php.net | Date: | Thu, 25 Oct 2001 23:15:44 +0000 |
| Subject: | note 15653 deleted from function.array-search by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-19449@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.