Re: incrementing in a for loop

From: Date: Mon, 12 Sep 2005 20:00:34 +0000
Subject: Re: incrementing in a for loop
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-222211@lists.php.net to get a copy of this message
this worked for me: [CODE]
               for ($myLoop = 0; $myLoop < 100; $myLoop= $myLoop + 5)
               {
                       print "<P>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. for ($i = 1; $i <= 6; $i++) { Is it possible to increment $i by 5? Thanks.
-- D. Aaron Germ Scarborough Library, Shepherd University (304) 876-5423 "Well then what am I supposed to do with all my creative ideas- take a bath and wash myself with them? 'Cause that is what soap is for" (Peter, Family Guy)

« previous php.general (#222211) next »