Re: [PHP] [php] explode that :) !

2003-08-16 Thread [EMAIL PROTECTED]
Looks like a really simple piece of code except for the cryptic variable names. John Taylor-Johnston wrote: $P1OC1Q1 = "1¶some text or some comment"; echo "Your score is: "; $score=split($P1OC1Q1,"¶"); echo $score[0]."\n"; Do I have to go through all that to get score[0] ? John -- Radi

Re: [PHP] [php] explode that :) !

2003-08-16 Thread John Taylor-Johnston
Kind of hoping to do shorten it like this: echo "Your score is: ".$score[0]=split($P1OC1Q1,"¶")."\n"; No such hopes? > Looks like a really simple piece of code except for the cryptic variable names. > > >$P1OC1Q1 = "1¶some text or some comment"; > >echo "Your score is: "; $score=split($P1OC1Q1,"

Re: [PHP] [php] explode that :) !

2003-08-16 Thread Mike Migurski
>echo "Your score is: "; $score=split($P1OC1Q1,"¶"); echo >$score[0]."\n"; > >Do I have to go through all that to get score[0] ? I think reset(split()) should work for getting the first element. - michal migurski- contact info an

RE: [PHP] [php] explode that :) !

2003-08-16 Thread Sævar Öfjörð
Why not: echo "Your score is: ".split($P1OC1Q1,"")."\n"; -Original Message- From: John Taylor-Johnston [mailto:[EMAIL PROTECTED] Sent: 17. ágúst 2003 03:48 To: [EMAIL PROTECTED] Subject: Re: [PHP] [php] explode that :) ! Kind of hoping to do shorten it l

Re: [PHP] [php] explode that :) !

2003-08-16 Thread John Taylor-Johnston
> Why not: > echo "Your score is: > ".split($P1OC1Q1,"¶")."\n"; Ok, but what happens when $P1OC1Q1 = "". It errors out. $P1OC1Q1 = "";#left blank $P1OC1Q2 = "1¶bunch of text"; $P1OC1Q3 = "1¶bunch of text"; $P1OC1Q4 = "1¶bunch of text"; $P1OC1Q5 = "1¶bunch of text"; $P1OC1Q6 = "1¶bunch of text";

Re: [PHP] [php] explode that :) !

2003-08-16 Thread John Taylor-Johnston
"")."\n"; > > -Original Message----- > From: John Taylor-Johnston [mailto:[EMAIL PROTECTED] > Sent: 17. ágúst 2003 03:48 > To: [EMAIL PROTECTED] > Subject: Re: [PHP] [php] explode that :) ! > > Kind of hoping to do shorten it like this: > &g

Re: [PHP] [php] explode that :) !

2003-08-16 Thread Curt Zirzow
* Thus wrote John Taylor-Johnston ([EMAIL PROTECTED]): > $P1OC1Q1 = "1¶some text or some comment"; > > echo "Your score is: "; $score=split($P1OC1Q1,"¶"); echo > $score[0]."\n"; > > Do I have to go through all that to get score[0] ? substr($P1OC1Q1, 0, strpos($P1OC1Q1, '¶')-1) That will return

Re: [PHP] [php] explode that :) !

2003-08-17 Thread Tom Rogers
Hi, Sunday, August 17, 2003, 12:58:23 PM, you wrote: JTJ> $P1OC1Q1 = "1¶some text or some comment"; JTJ> echo "Your score is: "; $score=split($P1OC1Q1,"¶"); echo $score[0]."\n"; JTJ> Do I have to go through all that to get score[0] ? JTJ> John if the number is always first and an integer: e

RE: [PHP] [php] explode that :) !

2003-08-18 Thread Ford, Mike [LSS]
On 17 August 2003 08:34, Tom Rogers wrote: > Hi, > > Sunday, August 17, 2003, 12:58:23 PM, you wrote: > > $P1OC1Q1 = "1¶some text or some comment"; > > > echo "Your score is: "; > $score=split($P1OC1Q1,"¶"); echo $score[0]."\n"; > > > Do I have to go through all that to get score[0] ? > > > Jo