note 17026 added to function.strpos
| From: | Michael-Rudel at gmx dot de | Date: | Thu, 22 Nov 2001 15:51:17 +0000 |
| Subject: | note 17026 added to function.strpos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-21167@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...
}
--
http://www.php.net/manual/en/function.strpos.php
http://master.php.net/manage/user-notes.php?action=edit+17026
http://master.php.net/manage/user-notes.php?action=delete+17026
http://master.php.net/manage/user-notes.php?action=reject+17026