Bug #3933 Updated: strpos doesn't find needle under certain conditions

From: Date: Mon, 27 Mar 2000 06:17:40 +0000
Subject: Bug #3933 Updated: strpos doesn't find needle under certain conditions
Groups: php.dev 
Request: Send a blank email to php-dev+get-17274@lists.php.net to get a copy of this message
ID: 3933 Updated by: rasmus Reported By: wayne@pruvodce.cz Status: Closed Bug Type: Misbehaving function Assigned To: Comments: This is not a bug. strpos("bleble","ble") returns position 0 as it should. The way you are doing your check is incorrect. The condition 0 == false is true. You want to check for an empty string here "" to check to see if the string was not found. A 0 return is a match. Please see the user notes in the online manual. http://www.php.net/manual/function.strpos.php3 Full Bug description available at: http://bugs.php.net/?id=3933

« previous php.dev (#17274) next »