Hello. Here I am again with my calendar script. Im trying to make it as simple as possible but can get it to work properly. As it is below it doesnt show the dates correctly and the table doesnt break after 7 days. Any tips ?
<?php
echo "<table border=1>";
echo "<tr><td colspan=7>".date("F Y")."</td></tr>";
$weekdays = array("Mon","Tue","Wed","Thu","Fri","Sat","Sun");
echo "<tr>";
foreach ($weekdays as $weekday) {
echo "<td>$weekday</td>";
} echo "</tr>";
echo "<tr>";
for ($dim=1; $dim<=date('t'); $dim++) {
$timestamp = strtotime(date("Y-m-".$dim));
$day = date("w", $timestamp);
if ($dim == date("d")) {
print "<td><b>$dim</b></td>";
}
elseif ($day==0 or $day==6) {
echo "<td><font color=red>$dim</font></td>";
}
else {
echo "<td>$dim</td>";
}}
echo "</tr>";
echo "</table>";
?>