Hello again.
Now Im one step further🙂 I get the weekdays to correspond with the dates. But still cant get the table to start a new row when it comes to the end of the week. Any tips would really be apreciated.
<?
$dates = date('t',mktime($hrs,$min,$sec,date('m'),date('d'),date('Y'))); # Days in current month
$week = date('w',mktime($hrs,$min,$sec,date('m'),date('d'),date('Y'))); # Days in week
$wd = array('Mon','Tue','Wed','Thu','Fri','Sat','Sun'); # Weekday names
echo "<table border=1>"; # Html table
echo "<tr>";
foreach($wd as $w) { #Loops through weekday names
echo "<td>$w</td>";
}
echo "</tr>";
for($i=0; $i<date("w",mktime(0,0,0,date("m"),0)); $i++) {
echo "<td><!--Empty Cells--></td>"; # Checks for empty cells in table
}
for($i=1; $i<=$dates; $i++) { # Loops through dates
if($i==date('d')) {
echo "<td><b>$i</b></td>";
}
else {
echo "<td>$i</td>"; # Prints all the days in the current month
}
}
echo "</tr>";
echo "</table>";
?>