note 68364 deleted from function.strpos by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 16:34:50 +0000 |
| Subject: | note 68364 deleted from function.strpos by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-154853@lists.php.net to get a copy of this message | ||
Note Submitter: wolfeym38 at yahoo dot com
----
I finally figured out how to use this function correctly (and efficiently) if you want to test for a
needle that may start at the beginning of haystack, simply use
if (strpos($haystack, $needle) === 0)) {
do stuff here..
}
someone else mentioned that you needed to assign a variable first and test to make sure that it was
=== true first.. That is not needed