$day | "; } echo "|
---|---|
", $startDayOfWeek); } for ($day = 1; $day <= $daysInMonth; $day++) { $dayOfWeek = ($startDayOfWeek + $day - 1) % 7; $class = $dayOfWeek == 0 ? "sunday" : ""; echo " | $day | ";
if (($day + $startDayOfWeek) % 7 == 0) {
echo "
", 7 - $endDayOfWeek); } echo " |