Re: [PHP] incrementing in a for loop

2005-09-13 Thread Burhan Khalid
Peppy wrote: I've searched online and am unable to find how to increment by more than one in a for loop. for ($i = 1; $i <= 6; $i++) { Is it possible to increment $i by 5? Everyone has responded with the correct answer, but you do realize that this loop will only run twice? It will print 1,

RE: [PHP] incrementing in a for loop

2005-09-12 Thread Chris W. Parker
D A GERM on Monday, September 12, 2005 1:01 PM said: > [CODE] > for ($myLoop = 0; $myLoop < 100; $myLoop= $myLoop + 5) > { > print "my loop: $myLoop"; > } > [/CODE] Where's the code? Oh there

Re: [PHP] incrementing in a for loop

2005-09-12 Thread Stephen Johnson
code */ ?> > From: "M. Sokolewicz" <[EMAIL PROTECTED]> > Date: Mon, 12 Sep 2005 23:48:05 +0200 > To: Stephen Johnson <[EMAIL PROTECTED]> > Cc: Peppy <[EMAIL PROTECTED]>, > Subject: Re: [PHP] incrementing in a for loop > > >> >&g

Re: [PHP] incrementing in a for loop

2005-09-12 Thread M. Sokolewicz
Stephen Johnson wrote: On 9/12/05 12:39 PM, "Peppy" <[EMAIL PROTECTED]> wrote: for ($i = 1; $i <= 6; $i++) { Is it possible to increment $i by 5? for ($i = 1; $i <= 6; $i+5) { that won't work; have you tried it? Because $i++ assigns the result of $i+1 to $i, while yours does not assign

Re: [PHP] incrementing in a for loop

2005-09-12 Thread D A GERM
this worked for me: [CODE] for ($myLoop = 0; $myLoop < 100; $myLoop= $myLoop + 5) { print "my loop: $myLoop"; } [/CODE] Peppy wrote: I've searched online and am unable to find how to increment by more than one in a for loop.

Re: [PHP] incrementing in a for loop

2005-09-12 Thread Stephen Johnson
On 9/12/05 12:39 PM, "Peppy" <[EMAIL PROTECTED]> wrote: > for ($i = 1; $i <= 6; $i++) { >Is it possible to increment $i by 5? for ($i = 1; $i <= 6; $i+5) { -- Stephen Johnson The Lone Coder http://www.ouradoptionblog.com *Join us on our adoption journey* [EMAIL PROTECTED] http://www.thelon

Re: [PHP] incrementing in a for loop

2005-09-12 Thread Philip Hallstrom
I've searched online and am unable to find how to increment by more than one in a for loop. for ($i = 1; $i <= 6; $i++) { Is it possible to increment $i by 5? Sure. for ($i = 1; $i <= 6; $i+=5) { -philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.ph