There are many calendars written in JavaScript on the Internet. These calendars read local time and may be inaccurate. So I wanted to find a calendar written in PHP that could read server time, but I couldn't find a suitable one, so I tried to write one myself.
Code copy box
0 && intval($HTTP_GET_VARS['month'])<13)?intval($HTTP_GET_VARS[' month']):date("m");
$ynow=(isset($HTTP_GET_VARS['year']) && intval($HTTP_GET_VARS['year'])>1969 && intval($HTTP_GET_VARS['year'])<2038)?intval($HTTP_GET_VARS[' year']):date("Y");
$mtime=mktime(0,0,0,$mnow,date("d"),$ynow);
$f=date("w",mktime(0,0,0,$mnow,1,$ynow))-1;
echo "
< ".$ynow."> | <".date("M",$mtime)." > | |||||
S | M | T | WT | F | S | $i%7==6)?" class="calendarw"":"").">"; if($i>$f)echo $i-$f; echo " | "; if($i%7==6)echo ""; } if($i%7<6 && $i%7>0)echo "" ; if($i%7==6)echo " | "; echo " |