View Single Post
Old 08-15-2007, 03:09 PM   #4 (permalink)
Taltos
v7n Mentor
 
Taltos's Avatar
 
Join Date: 11-22-06
Location: Phoenix, AZ
Posts: 1,804
iTrader: 0 / 0%
Latest Blog:
None

Taltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web proTaltos is a highly respected web pro
Send a message via Yahoo to Taltos
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!
__________________
Experimenting
Taltos is offline   Reply With Quote