Displaying a Month's Worth and Then Displaying in Red the Date of a Special Day

Ok sorry I’m still a beginner… I have this PHP script that displays the full month of the special date that I want to display in red. For example, here I have April 2013 month. I created a function so that when I choose the month and year will display that month. It’ll display Sun, Mon, Tue, Wed, Thur so on on the column then the days corresponding it for the full month. But, let say I’d like to flag the script so that a special day April 11th as my anniversary to display in red font to signify that that day is an important date of the month. Can someone help? Thanks in advance…

[php]function showMonth($month, $year)
{
$date = mktime(12, 0, 0, $month, 1, $year);
$daysInMonth = date(“t”, $date);
// calculate the position of the first day in the calendar (sunday = 1st column, etc)
$offset = date(“w”, $date);
$rows = 1;

echo "

Month of " . date(“F Y”, $date) . “

\n”;

echo “<table border=“1”>\n”;
echo “\t

Su M Tu W Th F Sa ”;
echo “\n\t”;

for($i = 1; $i <= $offset; $i++)
{
echo “

”;
}
for($day = 1; $day <= $daysInMonth; $day++)
{
if( ($day + $offset - 1) % 7 == 0 && $day != 1)
{
echo “\n\t”;
$rows++;
}

echo “

” . $day . “”;
}
while( ($day + $offset) <= $rows * 7)
{
echo “”;
$day++;
}
echo “\n”;
echo “\n”;
}[/php]

I got it to work using an if statement

Sponsor our Newsletter | Privacy Policy | Terms of Service