日期:2014-05-16 浏览次数:20544 次
$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")).'<br>';
}
<?php
//上个礼拜一
$n = strtotime("last week");
$timestrap = 86400;
for ($i=0; $i<7; $i++)
{
echo date('Y-m-d', $n+($i*$timestrap)),'<br />';
}
?>