Bug #912 Updated: strpos returns 0, when strpos(

From: Date: Thu, 12 Nov 1998 13:27:08 +0000
Subject: Bug #912 Updated: strpos returns 0, when strpos(
Groups: php.dev 
Request: Send a blank email to php-dev+get-2356@lists.php.net to get a copy of this message
ID: 912 Updated by: rasmus Reported By: haktan@cybercity.dk Status: Closed Bug Type: Misbehaving function Assigned To: Comments: Not true. strpos("abc","x") returns an empty string ("") not 0 while strpos("abc","a") returns 0. You can distinguish between the two cases with something like: if(strlen(strpos("abc",$char)) echo "Found"; Returning -1 would be inconsistent with the rest of PHP. Full Bug description available at: http://ca.php.net/bugs.php3?id=912 -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#2356) next »