I'm trying to create a calendar system that will show what jobs are booked in for certain days, I want it to be a horizontal calendar that has all of the days of the months as a table row and days of the week as the next row. I've got the first row sorted but I need to have the second row repeat the array of the days of the week until the month ends.
//Establish How many days are in the current Month
$currentMonthDays = date("t");
$daysOfWeek = array('M','T','W','T','F','Sa','Su');
echo '<table cellpadding="0" cellspacing="0" border="1" bordercolor="ffffff">
<tr>';
for ($i = 1; $i <= $currentMonthDays; $i++)
{
echo '<td width="30" align="center">'.$i.'</td>';
}
echo '</tr><tr>';
foreach($daysOfWeek as $day){
echo '<td width="30" align="center">'.$day.'</td>';
}
echo '</tr>';