$week = date ( 'w' ) == 0 ? 7 : date ( 'w' );
$monday = strtotime ( 'today -' . ($week - 1) . 'day' );
$sunday = strtotime ( 'today +' . (8 - $week) . 'day -1second' );
$monday_date = date("Y-m-d", $monday); // 本周一的日期(年-月-日)
$sunday_date = date("Y-m-d", $sunday); // 本周日的日期(年-月-日)
echo "本周一:".$monday_date."<br>";
echo "本周日:".$sunday_date;
发表评论