This was written in '03 but I'm not sure the PHP version, I just found it on an external zip drive i had
<?php
// *******************************************
// * CHANGE THESE VALUES TO YOUR PREFERANCES *
// *******************************************
// the default image when today isn't a special day
$default_bg = "background-leaves.jpg";
// these are the special days\
$backgrounds = array(
"11-20|11-29" => "tgiving.jpg",
"12-25|12-29" => "xmas.jpg",
"01-01|01-01" => "newyear.jpg",
"09-11|09-11" => "sep11.jpg",
"11-11|11-11" => "vetsdayjpg",
"03-17|03-17" => "stpats.jpg",
"03-23|03-23" => "easter.jpg",
);
// this gets todays date in the mm-dd format
$today = date("m-d");
// for testing purposes it prints the date
// echo "Today is: ".$today."<br><br>";
// this checks to see if today is a special day
foreach($backgrounds)
{
$dates = explode("|", $backgrounds[0]);
$start_date = $dates[0];
$end_date = $dates[1];
if($start_date == $today)
{
$today_bg = $backgrounds[1];
return;
}
else
{
$today_sin = str_replace("-","", $today);
$start_date_sin = str_replace("-","", $start_date);
$end_date_sin = str_replace("-","", $end_date);
if(($today_sin <= $end_date_sin) && ($today_sin >= $start_date_sin))
{
$today_bg = $backgrounds[1];
return;
}
else
{
$today_bg = $default_bg;
}
}
}
function css($f_cssfile)
{
global $today_bg;
$f_file = file_get_contents($f_cssfile);
$f_file = str_replace("__BG", $today_bg, $f_file);
echo "<style>";
echo $f_file;
echo "</style>";
}
?>