i think it could be done this way.
havent tested it
function getTodaysPicture()
{
// todays date
$today = date('d-m-Y');
// standard files are named 01.jpg to 31.jpg etc.
// the picture filename will be here in the end
$picture = date('d') .'.jpg';
// special days which require another picture
$special_days = array(
array('date' => '22-10-2005', 'pic' => 'today.jpg');
array('date' => '31-10', 'pic' => 'endofoctober.jpg');
);
// running through those special days
foreach($special_days as $key => $val)
{
$tmp_d = substr($today, 0, strlen($val['date']));
if ($tmp_d == $val['date']) {
$picture = $val['pic'];
}
}
if ((!file_exists($picture)) || (!is_readable($picture))) {
return false;
} else {
return $picture;
}
}