Re: [PHP4BETA] New function chrcount

From: Date: Mon, 24 Apr 2000 13:06:29 +0000
Subject: Re: [PHP4BETA] New function chrcount
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-14010@lists.php.net to get a copy of this message
>>You can really simplify it if you assume that after you match a string >>you simply start matching at the end of the previous match. So, in this >>case it would find 3 occurrences. I don't think the alternative is very >>useful. > >More importantly, if it's clearly documented that str_count() does not count >overlapping matches, the few people who actually need to do such a thing can >roll their own function. I doubt many people would have problems with a >function which does what 99% of the users need but ommits a special case. Why not give it an optional mode parameter like chr_count()? Then the special case can be added later. John -- /* SteeleSoft Consulting John Steele - Systems Analyst/Programmer * We also walk dogs... jsteele@writeme.com * http://www.gamecomputer.com/ssc/ */

« previous php.version4 (#14010) next »