时间:2021-07-01 10:21:17 帮助过:22人阅读
function getmonsun(){ $curtime=time(); $curweekday = date('w'); //为0是 就是 星期七 $curweekday = $curweekday?$curweekday:7; $curmon = $curtime - ($curweekday-1)*86400; $cursun = $curtime + (7 - $curweekday)*86400; $cur['mon'] = $curmon; $cur['sun'] = $cursun; return $cur; } $cur = getmonsun(); echo date('y-m-d',$cur['mon']); echo "rn"; echo date('y-m-d',$cur['sun']); //方法二 利用php strtotime函数 echo strtotime('last monday'); echo '
'; echo strtotime('next sunday');
http://www.bkjia.com/PHPjc/447015.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/447015.htmlTechArticle取出周一和周日的时间戳 能过下面两款取出周一和周日的时间戳实例可以看得出来很多的东西,要不断的思想哦,第一个自定的取出指定日...