Re: Loop within Loop help please
| From: | Nick Wilson | Date: | Tue, 28 Sep 2004 19:10:19 +0000 |
| Subject: | Re: Loop within Loop help please | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-198105@lists.php.net to get a copy of this message | ||
* and then Jason Davidson declared....
> I see lots of references to modulus, which works fantastic.. but how
> abut just testing if its equal to 20, then there isnt that extra
> arthmitc call.. this is just another way to do the same thing.. take
> your pick.. unless someone can see a bad reason for this method.
>
> $count = 0;
> foreach ..... {
> if($count == 20) {
> .............
> $count = 0;
> } else {
> $count++;
> }
> }
That would be fine, but im afraid in my effort to make the example
simple i forgot to ad a line:
$count++; ;-)
--
Nick W