【发布时间】:2023-03-19 19:11:01
【问题描述】:
我需要显示所选月份对应周的日期范围。
假设选定的值为$month=2 和$year=2017。
输出应显示所选特定月份中几周的范围日期列表。
$month = $_GET['month'];
$year = $_GET['year'];
...
Output:
Week 1: 01/02/2017 - 05/02/2017
Week 2: 06/02/2017 - 12/02/2017
Week 3: 13/02/2017 - 19/02/2017
Week 4: 20/02/2017 - 26/02/2017
Week 5: 27/02/2017 - 28/02/2017
我查看了 Split the current month in to weeks in php 、 Get week number in month from date in PHP? 和 Split date ranges into corresponding weeks ,但没有一个对我有用。
谢谢。
【问题讨论】: