Home >php教程 >php手册 >用php编写的日历

用php编写的日历

WBOY
WBOYOriginal
2016-06-13 09:59:581680browse

网上有很多JavaScript编写的日历,这种日历读取的是本地的时间,可能会不准确。所以想找一个用php编写的,能读取服务器时间的日历,但是一直都找不到合适的,于是我自己尝试着写了一个。
代码
$mnow=(isset($HTTP_GET_VARS['month']) && intval($HTTP_GET_VARS['month'])>0 && intval($HTTP_GET_VARS['month'])$ynow=(isset($HTTP_GET_VARS['year']) && intval($HTTP_GET_VARS['year'])>1969 && intval($HTTP_GET_VARS['year'])$mtime=mktime(0,0,0,$mnow,date("d"),$ynow);
$f=date("w",mktime(0,0,0,$mnow,1,$ynow))-1;
echo "

";
echo "";
echo "";
for($i=0;$iif($i%7==0)echo "";
echo "";
if($i%7==6)echo "";
}
if($i%70)echo "";
if($i%7==6)echo "";
echo "
<".$ynow."> <".date("M",$mtime).">
S M T W T F S
";
if($i>$f)echo $i-$f;
echo "
";
?>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PHP-GTK 介绍及其应用Next article:php 浏览目录