".mysql_error()); $today = date("jS \of F", $day); $ids = array(); $saintnames = array(); if(mysql_num_rows($sd) > 0){ $title = "British Saints Days, $today - "; $description = "The meanings and origin of UK saints days, $today is "; while($saint = mysql_fetch_object($sd)){ $saintnames[] = $saint->content; $description .= " $saint->content "; $ids[] = $saint->id; } $title .= implode(', ',$saintnames); mysql_data_seek($sd, 0); } else{ $title = "British Saints Days"; $description = "The meanings and origin of UK saints days"; } $dayyear = date("z", $day)+1; switch($dayyear){ case substr($dayyear, -1) == 1 && substr($dayyear, -2, 1) != 1 : case 1: $suffix = 'st'; break; case substr($dayyear, -1) == 2 && substr($dayyear, -2, 1) != 1: $suffix = 'nd'; break; case substr($dayyear, -1) == 3 && substr($dayyear, -2, 1) != 1 : $suffix = 'rd'; break; default: $suffix = 'th'; } $days = range(1,31); $months = array(1 => 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); echo <<$title FOO; ?>
$today - ".implode(', ',$saintnames)."\n"; include'linkunit.txt'; echo"

$today is the $dayyear$suffix day of the year"; /*if(!function_exists('file_exists')){ function file_exists($path){ return (@fopen($path,"r")==true); } }*/ echo'

'; foreach($ids as $sid){ if(file_exists("images/saints/$sid.jpg")){ echo "
"; } } echo'
'; if(mysql_num_rows($sd) > 0){ while($saint = mysql_fetch_object($sd)){ if($saint->explanation){ echo"

$saint->content:
".nl2br($saint->explanation).'

'; } else{ echo"

Sorry, we dont have an origin for $saint->content

"; } } } else{ echo"

Sorry, we dont have a saintsday for $today

"; } ?>

Choose another day:

EOT; foreach($months as $key => $value){ echo"\n"; } ?>