- $date=new DateTime();//时间对象
- $date->modify('this week');//指定哪一周,默认该周的第一天
- echo $date->format('Y-m-d');//输出周一的年月日
- $date->modify('this week +6 days');//该周的周日
- echo $date->format('Y-m-d');//输出周日的年月日
- //该片段来自于http://www.codesnippet.cn/detail/0807201614832.html
来源: http://www.codesnippet.cn/detail/0807201614832.html