我敲上了 不对啊 只调月份调到12月以后年份还是不变的
永~不~低~头
永~不~低~头 2018-08-30 13:55:29
[PHP讨论组]

// error_reporting(E_ALL & ~E_NOTICE);

$mon = date("m");

$year = date("Y");

$year = isset($_GET['y'])?$_GET['y']:$year;

echo $_GET['y'];

echo $year;

$mon = isset($_GET['m'])?$_GET['m']:$mon;

$day = date("t",mktime(0,0,0,$mon,1,$year));

$w = date("w",mktime(0,0,0,$mon,1,$year));



echo "

";

echo "

{$year}年{$mon}月

";

echo "

";

echo "

";

echo "

";

echo "

";

echo "

";

echo "

";

echo "

";

echo "

";

echo "

";

$d = 1;

while ($d<=$day){

echo "

";

for ($i=1;$i<=7;$i++){

if(($d<=$day) && ($w<$i|| $d!=1)){

echo "

";

$d++;

}else{

echo "

";

}

}

echo "

";

}


$prem = $nextm = $mon;

$prey = $nexty = $year;

if ($mon<=1){

$prem = 12;

$prey--;

}else {

$prem--;

}

if ($mon>=12){

$nextm = 1;

$nexty++;

}else {

$nextm++;

}

$prey = $year - 1;

$nexty = $year + 1;

echo "

";

echo "

";

echo "

";


echo "

{$d}
";

echo "<<";

echo "{$year}年";

echo ">>";

echo " ";

echo "<";

echo "{$mon}月";

echo ">";

echo "

";


永~不~低~头
永~不~低~头

全部回复(0)
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号