note 12768 deleted from function.strpos by jimw

From: Date: Thu, 18 Oct 2001 21:27:09 +0000
Subject: note 12768 deleted from function.strpos by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-19133@lists.php.net to get a copy of this message
It seems that: // in versions older than 4.0b3: $pos = strpos ($mystring, "b"); if (is_string ($pos) && !$pos) { // not found... } does NOT work in newer than PHP4.0b3. If you encoutner strange behaviour of your scripts (especially if loop with conditions based on strpos result), try the newer syntax: // in PHP 4.0b3 and newer: $pos = strpos ($mystring, "b"); if ($pos === false) { // note: three equal signs // not found... } Took me some time to discover this incompatibility...

« previous php.notes (#19133) next »