note 61939 deleted from function.strpos by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 16:36:07 +0000 |
| Subject: | note 61939 deleted from function.strpos by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-154860@lists.php.net to get a copy of this message | ||
Note Submitter: php /at/ da.mcbf.net
----
"fox_galih at yahoo dot co dot uk" example below is absolutely not needed. As the example
on this page shows, you can differentiate between position 0 and false by doing a strict comparison
(===):
$newsbody = "<p>This is paragraph</p>";
if( strpos( $newsbody, "<p>" ) === 0 ) {
// will only get executed if string starts with <p>
// (false === 0) evaluates to false
}