note 58169 deleted from function.array-search by felipe
| From: | felipe@php.net | Date: | Sun, 10 Feb 2008 13:09:28 +0000 |
| Subject: | note 58169 deleted from function.array-search by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-135949@lists.php.net to get a copy of this message | ||
Note Submitter: hakkierulez at nospamas dot hotmail dot nospam dot com
----
If you simply want check if the search string is found, do this: (since the array number 0 evaluates
as FALSE)
<?php
if (array_search($needle, $array)!== FALSE) {
//code goes here (
}
?>