note 17026 deleted from function.strpos by jimw
| From: | jimw@php.net | Date: | Fri, 14 Dec 2001 20:07:48 +0000 |
| Subject: | note 17026 deleted from function.strpos by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22702@lists.php.net to get a copy of this message | ||
Ok, so my above sample still doesn't covers values found at pos 0. This one does the right,
since strpos returns a bool/false if nothing is found:
// in versions older than 4.0b3:
$pos = strpos($mystring, "b");
if (is_integer($pos)) {
// found...
}
or
// in versions older than 4.0b3:
$pos = strpos($mystring, "b");
if (is_bool($pos)) {
// not found...
}