PHP 当周日期
2016-09-06 本文已影响15人
jadn
$week_now = date("w");
$week_start = strtotime("-$week_now days",time());
$week_end = strtotime("+".(6-$week_now)." days",time());
echo date("Y-m-d",$week_start)."
";
echo date("Y-m-d",$week_end);
?>
$week_now = date("w");
$week_start = strtotime("-$week_now days",time());
$week_end = strtotime("+".(6-$week_now)." days",time());
echo date("Y-m-d",$week_start)."
";
echo date("Y-m-d",$week_end);
?>