Historic British Dates
0){
$check = '';
$no = 1;
while($row = mysql_fetch_object($q)){
if(!empty($row->year)){
if(strlen($row->year) == 10){
$months= array('01'=>"January",'02'=>"February",'03'=>"March",'04'=>"April",'05'=>"May",'06'=>"June",'07'=>"July",'08'=>"August",'09'=>"September",'10'=>"October",'11'=>"November",'12'=>"December");
$month = $months[substr($row->year, 5, 2)];
$day = substr($row->year, 8, 2);
$day = (substr($day, 0, 1) == 0) ? substr($day, 1) : $day;
switch($day){
case(substr($day, -1, 1) == 1 && substr($day, 0, 1) != 1):
$suffix = 'st';
break;
case(substr($day, -1, 1) == 2 && substr($day, 0, 1) != 1):
$suffix = 'nd';
break;
default:
case(substr($day, -1, 1) == 3):
$suffix = 'rd';
break;
default:
$suffix = 'th';
}
$yy = substr($row->year, 0, 4);
if(substr($yy, 0, 1) == 0){ $yy = substr($yy, 1);}
$fdate = "$day$suffix of $month $yy :";
}
else{$fdate = $yy = $row->year;}
echo"$fdate ";
}
if(!empty($row->detail)){echo"$row->name\n";}
else{echo"$row->name\n";}
if($no < mysql_num_rows($q)){echo'
';}
$no++;
}
}
echo'
Click below to list Historic Dates by County:
'; while($cou = mysql_fetch_object($co)){ if($check != $cou->cname){ echo"$cou->cname: "; $check = $cou->cname; } echo"$cou->CountyName | \n"; } echo'
'; include'books.txt'; include'dailyfeature.php'; ?>