If I understand this right modules is used to divide a number and if there is a remainder that remainder is used?
here is part of a code that I'm trying to understand which produce part of a Calendar
[PHP]<?php
$days = Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
echo "<TABLE BORDER=1 CELLPADDING=5><tr>\n";
foreach ($days as $day) {
echo "<TD BGCOLOR=\"#CCCCCC\" ALIGN=CENTER><strong>$day</strong></td>\n";
}
for ($count=0; $count < (6*7); $count++) {
$dayArray = getdate($start);
if (($count % 7) == 0) {
if ($dayArray['mon'] != $month) {
break;
} else {
echo "</tr><tr>\n";
}
}
if ($count < $firstDayArray['wday'] || $dayArray['mon'] != $month) {
echo "<td> </td>\n";
} else {
echo "<td>".$dayArray['mday']." </td>\n";
$start += ADAY;
}
}
echo "</tr></table>";
?>[/PHP]
The part I'm trying to understand is
[PHP]if (($count % 7) == 0) {
if ($dayArray['mon'] != $month) {
break;
} else {
echo "</tr><tr>\n";
}[/PHP]
I know its trying to produce rolls for the week, but i just don't get it. I have read how its works several times. Question what is $count % 7) == 0 being divide by were does the variable $count gets it value from?
thanks
nomad
PS if you need more code I can give it out.