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