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 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:

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]

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 Pmy 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 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 Stephen Johnson
PROTECTED] continuing the struggle against bad code */ ? From: M. Sokolewicz [EMAIL PROTECTED] Date: Mon, 12 Sep 2005 23:48:05 +0200 To: Stephen Johnson [EMAIL PROTECTED] Cc: Peppy [EMAIL PROTECTED], php-general@lists.php.net Subject: Re: [PHP] incrementing in a for loop

RE: [PHP] incrementing in a for loop

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