Re: [PHP] string length?

2001-01-30 Thread Jon Jacob
Kevin Connolly wrote: > > Hi, > I am quite new to PHP scripts and I have run into a little problem with my string! > I have a string called $numbers which is 5;6;12;21;36;42 (for example, it can be any >6 numbers between 1 and 42). > Is there an easy way that I can find out how many numbers ther

Re: [PHP] string length?

2001-01-30 Thread Philip Olson
Hi Kevin, First thought that comes to mind is explode() so something like : I assume that would work. That explodes it into an array then counts it, check out : http://www.php.net/manual/en/function.explode.php It's a really fun function to play with. Regards, Philip Olson http://

Re: [PHP] string length?

2001-01-30 Thread Joe Stump
if you just want to know how many numbers are in it you can do this: $num_of_numbers = sizeof(explode(';',$string)); --Joe On Tue, Jan 30, 2001 at 04:46:50PM -0800, Jon Jacob wrote: > Kevin Connolly wrote: > > > > Hi, > > I am quite new to PHP scripts and I have run into a little problem with

RE: [PHP] string length?

2001-01-31 Thread Maxim Maletsky
I would do : $num = substr_count($numbers, ';'); +/- whatever the difference it could make Cheers, Maxim Maletsky -Original Message- From: Joe Stump [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 31, 2001 12:29 PM To: Jon Jacob Cc: [EMAIL PROTECTED] Subject: Re: [P