PHP Code for Calendar
Posted On at by milan
function showCalendar(){
// Get key day informations.
// We need the first and last day of the month and the actual day
$today = getdate();
$firstDay = getdate(mktime(0,0,0,$today['mon'],1,$today['year']));
$lastDay = getdate(mktime(0,0,0,$today['mon']+1,0,$today['year']));
// Create a table with the necessary header informations
echo '
| '.$today['month']." - ".$today['year']." | ||||||
|---|---|---|---|---|---|---|
| Mo | Tu | We | Th | ';Fr | Sa | Su |
| '; | $actday | ";|||||
| $actday | ";||||||
| $actday | ";'; | |||||
}
showCalendar();
?>