note 31011 added to function.strpos

From: Date: Sun, 06 Apr 2003 21:40:48 +0000
Subject: note 31011 added to function.strpos
Groups: php.notes 
Request: Send a blank email to php-notes+get-46289@lists.php.net to get a copy of this message
You could also try this, which is quite simple: if ( strpos( $str1, $str2 ) >-1 ) { #do something; } This should work, because 0 is greater -1, but the statement false is not greater -1 because of different types. -- http://www.php.net/manual/en/function.strpos.php http://master.php.net/manage/user-notes.php?action=edit+31011 http://master.php.net/manage/user-notes.php?action=delete+31011 http://master.php.net/manage/user-notes.php?action=reject+31011

« previous php.notes (#46289) next »