时间:2021-07-01 10:21:17 帮助过:17人阅读
$week_start = date("U",mktime(0,0,0,date("m"),date("d")-7,date("Y")));
$week_end = date("U",mktime(23,59,59,date("m"),date("d")-0,date("Y")));
$date=date('Y-m-d',$week_start);
$date1=date('Y-m-d',$week_end);
for($i=7; $i>=0; $i--)
{
echo date('Y-m-d',strtotime("-$i day")).'
';
}
//上个礼拜一
$n = strtotime("last week");
$timestrap = 86400;
for ($i=0; $i<7; $i++)
{
echo date('Y-m-d', $n+($i*$timestrap)),'
';
}
?>