note 30899 added to function.substr-count

From: Date: Wed, 02 Apr 2003 15:16:51 +0000
Subject: note 30899 added to function.substr-count
Groups: php.notes 
Request: Send a blank email to php-notes+get-46130@lists.php.net to get a copy of this message
3 is right. It should not return 6. If it is starting from left to right it sees "cgc" then the next character is a "g" so that character is skipped. So the next occurence happens on the next "cgc". As you can see this only happens 3 times. Now you can get 6 if after the first "cgc" you back up a character. -- http://www.php.net/manual/en/function.substr-count.php http://master.php.net/manage/user-notes.php?action=edit+30899 http://master.php.net/manage/user-notes.php?action=delete+30899 http://master.php.net/manage/user-notes.php?action=reject+30899

« previous php.notes (#46130) next »