Calendar Small algorithm:
<?PHPEcho"<table align= ' center ' border= ' 1 ' >";Echo"<th style= ' Background-color:green; ' > Day </th> ";Echo"<th style= ' Background-color:green; ' > A </th> ";Echo"<th style= ' Background-color:green; ' > Two </th> ";Echo"<th style= ' Background-color:green; ' > Three </th> ";Echo"<th style= ' Background-color:green; ' > Four </th> ";Echo"<th style= ' Background-color:green; ' > Five </th> ";Echo"<th style= ' Background-color:green; ' > Six </th> ";$year=isset($_get[' Year ']) ?$_get[' Year ']:Date(' Y ');$month=isset($_get[' Month ']) ?$_get[' Month ']:Date(' m ');$day=isset($_get[' Day ']) ?$_get[' Day ']:Date(' d ');$startWeek=Date(' W ',Mktime(0,0,0,$month, 1,$year));//Day 1th of the month is the day of the week Param:hour minute second month days year//w weekEcho"Today is$yearYears$monthMonths$dayDay;$days=Date(' t ',Mktime(0,0,0,$month, 1,$year));//How many days are there in the monthEcho"<tr>"; for($i= 0;$i<$startWeek;$i++) {Echo"<td></td>";//fill in a few vacancies} for($j= 1;$j<=$days;$j++) {$i++;if($day==$j) {Echo"<td style= ' background-color:red; ' >$j</td> ";} Else {Echo"<td>$j</td> ";}if($i%7 = = 0) {Echo"</tr><tr>";//enough 7 to wrap.}} while($i%7! = 0) {Echo"<td></td>";//Last Fill space$i++;}Echo"<tr/>";Echo"</table>";Header(' Content-type:text/html;charset=utf-8 ');
Calendar Small algorithm: