Get first/second/thrid weekend day of a specific month in PHP
Posted on 2009-04-30
I'm trying to find a way to get the first/second/thrid/fourth/last weekend day of a specific month in PHP.
I know I can do this for weekdays using strtotime('first weekday', mktime(0, 0, 0, 5, 1, 2009)) but I need a solution to do the same for weekend days.
For example the first weekend day in May is the Saturday 2nd. The second weekend day in May is Sunday the 3rd. The third weekend day in May is Saturday 9th etc.
Can anyone provide a way to do this to produce the above results?