Re: Re[2]: [PHP] counting words in a string

2002-09-28 Thread olinux
wouldn't it be easier and more efficient to simply count the number of spaces in the string (and add 1)? using substr_count or something similar olinux --- Justin French <[EMAIL PROTECTED]> wrote: > You need to look at a few options... one is regular > expression (not my > forte), or perhaps w

Re: Re[2]: [PHP] counting words in a string

2002-09-28 Thread debbie_dyer
rray functions to do whatever else you need to do - counting, positions, etc Debbie - Original Message - From: "Justin French" <[EMAIL PROTECTED]> To: "Richard Kurth" <[EMAIL PROTECTED]>; "php-general" <[EMAIL PROTECTED]> Sent: Saturday, Sept

Re: Re[2]: [PHP] counting words in a string

2002-09-28 Thread Justin French
You need to look at a few options... one is regular expression (not my forte), or perhaps winding through the string one character at a time, writing a very simple state engine. Justin French on 28/09/02 4:47 PM, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: > Hello Justin, > > That worked per

Re[2]: [PHP] counting words in a string

2002-09-27 Thread rdkurth
Hello Justin, That worked perfect but I have one more problem I need to know if one of the word is UNAVAILABLE I need to know if it is the first one or the second one. I don't know if there is any way to do this. 1st 2nd $string ="UNAVAILABLE AVAILABLE More Info";