note 61666 deleted from function.array-search by felipe
| From: | felipe@php.net | Date: | Sun, 10 Feb 2008 13:09:20 +0000 |
| Subject: | note 61666 deleted from function.array-search by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-135948@lists.php.net to get a copy of this message | ||
Note Submitter: ludvig dot ericson at gmail dot com
----
In response to the post beneath,
<?php
if ($userID = array_search($whatever, $array) !== false) {
}
?>
will also work, since it will be tested for explicitly NOT being a boolean false afterwards.