View Single Post
Old 08-15-2007, 11:12 PM   #5 (permalink)
ToddW
Moderator
 
ToddW's Avatar
 
Join Date: 01-11-04
Location: Folsom
Posts: 2,646
iTrader: 0 / 0%
ToddW is a web professional of the highest orderToddW is a web professional of the highest orderToddW is a web professional of the highest orderToddW is a web professional of the highest orderToddW is a web professional of the highest orderToddW is a web professional of the highest orderToddW is a web professional of the highest orderToddW is a web professional of the highest orderToddW is a web professional of the highest orderToddW is a web professional of the highest orderToddW is a web professional of the highest order
Send a message via AIM to ToddW
Quote:
Originally Posted by Taltos View Post
The one thing I would add to Capo64's solution would be to use modulus and then you don't have to reset the counter. Something like:

Code:
$i = 1; if($i % 5 = 0) echo <br />
The % is modulus which returns the remainder of a division. Everytime it is 0, you have looped 5 times. For this particular case, Capo's solution is just as good although later you may find you get into bigger projects and the modulus technique will be more useful. Have fun!
Keep this stuff in mind for pagination too
__________________
Learn about Bear Grylls, Les Stroud, Man Vs. Wild & SurvivorMan at Survival TV Shows
Order Exciting Inspirational Posters from Inspirational Posters at great value.
ToddW is offline   Reply With Quote