Your Location is: Home > Php

PHP - Get Week's start date and end date by month-year

From: Nauru View: 2993 Ronak Solanki 

Question

Thank you in advance

I searched for so many solutions but I did not get what I need

For an example - I want to get all the weeks and it's a start date and end date

Like if I say September-2020 then I need all the weeks with start and end date

The output should like below (Monday should be the first day of a week so the week is from Monday-Sunday)

Week 1 ->  2020-08-31 To  2020-09-06
Week 2 ->  2020-09-07 To  2020-09-13
Week 3 ->  2020-09-14 To  2020-09-20
Week 4 ->  2020-09-21 To  2020-09-27
Week 5 ->  2020-09-28 To  2020-10-04

Best answer