note 63539 deleted from function.strpos by danbrown

From: Date: Sun, 17 May 2009 16:35:46 +0000
Subject: note 63539 deleted from function.strpos by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-154857@lists.php.net to get a copy of this message
Note Submitter: leibwaechter at web dot de ---- If you only want to look, if a string appears in another string - even at position 0 - , you can also use substr_count(): <?php $mystring = "Hello Chris"; if (substr_count($mystring, "Hello") == 0) echo "no"; // same as: if (strpos($mystring, "Hello") === false) echo "no"; ?>

« previous php.notes (#154857) next »