How to extract every Monday and every fortnightly Monday from a range of two dates in PHP?
I'm using the infamous jQuery UI's Datepicker, and in my form I select a range of two dates. First represents the starting date and the other represents the end date. What I need now is the algorthm, some tips and directions or helpers for calculating every Monday between these two dates. For instance: start: 2011-06-01 end: 2011-06-30 Should extract me these 4 (four) dates witch lay on Mondays: 1st: 2011-06-06 2nd: 2011-06-13 3rd: 2011-06-20 4th: 2011-06-27 How could I achive this? And also, I'd need it for every fortnightly Monday: Result for fortnightly should be: 1st: 2011-06-06 2rd: 2011