Thread: PHP Question
View Single Post
Old 01-14-2002, 12:10 AM  
FATPad
Confirmed User
 
Join Date: Oct 2001
Posts: 6,693
Keep a counter of how many lines you've printed and every time you print a line check the mod result of the counter.

if ($counter%5=0) {
echo "This is the line to print every 5th line."
}

Basically if the reminder of the counter divided by 5 is 0 you want to print that line. I typed it wrong before and this probably wrong, too, but that's the general concept anyways.

[This message has been edited by FATPad (edited 01-13-2002).]
FATPad is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote