<center><b><u><?php echo date("F"); ?></u></b></center>

<table align="center" cellpadding="5" width="150">
<tr>
  <td><font color="red">S</font></td>
  <td><font color="red">M</font></td>
  <td><font color="red">T</font></td>
  <td><font color="red">W</font></td>
  <td><font color="red">T</font></td>
  <td><font color="red">F</font></td>
  <td><font color="red">S</font></td>
</tr>

<?php
    $max_days 
date("t");                                             // grab the number of days in the month
    
$ts getdate(mktime(000date("n"), 1,date("Y"), 0));         // disect and obtain the day of the week at day 1 of the month
    
$offset $ts["wday"];                                             // set the numeric value of day of the week on day 1
    
$highlight date("j");




    for (
$k 1$k <= $max_days$k++)
        
$dayO[$k+$offset] = $k;                                        // calculate the offset so day 1 starts on the right day of week




    
for ($week 1$week <= 5$week++)                               // fill in the blanks!
    
{
        echo 
"<tr>";
        for (
$datee 1$datee <= 7$datee++)
        {
            echo 
"<td>";
            if (
$highlight == $dayO[((7*$week)-(7-$datee))])  // check to see current date
                
echo str_replace ($highlight"<b>".$dayO[((7*$week)-(7-$datee))]."</b>"$dayO[((7*$week)-(7-$datee))]);  // highlight the current date
            
else
                echo 
$dayO[((7*$week)-(7-$datee))];                    // if not current date, then print out a plain-weight numeral
            
echo "</td>";
        }
    }
    echo 
"</tr>";
?>

</table>