I know I can get last Thursday with this
$firstdate = strtotime('last thursday');
However, from the moment this question is published, it will return
August 2nd, 2012
I need the last Thursday following this two-week cycle:
- August 9th
- August 23
- 6 September
- September 20
And every second Thursday after that.
So, if the current date is August 10th, she will be back on August 9th
If the current date is August 21, it will also return on August 9 (even if the previous Thursday is August 16).
If the current date is August 24th, she will return on August 23rd
If the current date is September 1, it will also return on August 23 (although the previous Thursday is August 30)
source share