<?php
function getDay(){
$timestr = time(); //当前时间戳
$now_day = date('w',$timestr); //当前是周几
//获取周一
$monday_str = $timestr - ($now_day-1)*60*60*24;
$monday = date('Y-m-d', $monday_str);
//获取周日
$sunday_str = $timestr + (7-$now_day)*60*60*24;
$sunday = date('Y-m-d', $sunday_str);
for($i=0;$i<7;$i++)
{
$arr[$i]['start']=strtotime(date('Y-m-d',strtotime($monday.'+'.$i.'day')));
$arr[$i]['end']=strtotime(date('Y-m-d',strtotime($monday.'+'.$i.'day')). " 24:00:00");
}
return $arr;
}
?> 本文结束



上一篇