Re: [PHP4BETA] New function chrcount
| From: | Peter Kovacs | Date: | Mon, 24 Apr 2000 20:57:30 +0000 |
| Subject: | Re: [PHP4BETA] New function chrcount | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-14007@lists.php.net to get a copy of this message | ||
You'll have to forgive me, I'm not entirely familiar with all the inner
workings of PHP, so I'm not exactly sure what the function does. I think
the complication arises because we are looking for all occurences, not
just a single occurence.
For example take the following call str_count("aaaaaa", "aa")
If we're just doing something like strpos then that's easy. However, in
this case is the answer 3 or is it 5? Its that kind of complication that
I was trying to avoid.
On Mon, 24 Apr 2000, Andrei Zmievski wrote:
> On Mon, 24 Apr 2000, Peter Kovacs wrote:
> > Okay then str_count it is. Of course, right now it only looks for every
> > instance of a single character (as opposed to a substring)... That kind of
> > functionality is far too complicated for me to implement at the
> > moment. (See previous posts)
>
> Why is it complicated? Wouldn't you just use php_memnstr() to look for
> the string occurrences along the string?
>
>
>
> -Andrei
>
> 'Any given program, when running correctly, is obsolete.'
> - First Law of Computer Programming
>
> --
> PHP 4.0 Beta Mailing List <http://www.php.net/version4/>
> To unsubscribe, e-mail: php4beta-unsubscribe@lists.php.net
> For additional commands, e-mail: php4beta-help@lists.php.net
> To contact the list administrators, e-mail: php4beta-admin@lists.php.net
>
>
--------------------------------------------------
Peter D. Kovacs KnowPost.com LLC
Lead Engineer peter@knowpost.com
--------------------------------------------------