Re: [PHP] Using while as for...

2001-02-24 Thread Steve Edberg
At 12:44 PM -0800 2/24/01, Felipe Lopes wrote: >I was trying to code the following script using while instead of for, >but I'm havig a lot of problems...Is it possible to do what I want? > >for ($count = 0; $count <= 10; $count++){ >echo "Number is $count \n"; >} > >Could anyone tell me how is it

RE: [PHP] Using while as for...

2001-02-23 Thread PHPBeginner.com
you can do while($count<=10) { echo "Number is $count \n"; $count++; } Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -Original Message- From: Felipe Lopes [mailto:[EMAIL PROTECTED]] Sent: Wed

Re: [PHP] Using while as for...

2001-02-23 Thread Andrew Hill
Whups, forgot a blasted semicolon... $count = 1; while($count < 10) { echo "Number is $count \n"; $count++; } Cheers, Andrew On 2/24/01 12:20 AM, "Andrew Hill" <[EMAIL PROTECTED]> wrote: > $count = 1; > > while($count < 10) > { >echo "Number is $count \n"; >$coun

Re: [PHP] Using while as for...

2001-02-23 Thread Andrew Hill
$count = 1; while($count < 10) { echo "Number is $count \n"; $count++ } > for ($count = 0; $count <= 10; $count++){ > echo "Number is $count \n"; > } > > Could anyone tell me how is it with while instead of for?? > Thank you!! Best regards, Andrew --

RE: [PHP] Using while as for...

2001-02-23 Thread ..s.c.o.t.t..
this is how you'd do it, in any of three ways, depending on the values you want to start/stop with. //counts from 0 to 10 $count=0; while ($count <= 10) { echo "$count, "; $count++; } print ""; //counts from 1 to 10 $count=0; while (++$count <= 10) { echo "$count, "; } pr