In my PHP app I have three variables:
Code:
$year = 2014
$weeknumber = 1
$weekstarts = 6 //Week starts on Saturday. 1=Monday... 6=Saturday and 7=Sunday
With these three parameters I would like to figure out what is the first day of the week. In this case, the 1st week of 2014, when the week starts on Saturday, is December 28th. 2014-01-04.
For weeks that start on Monday I can easily figure this out with:
Code:
$first_day_of_week = strtotime( $year . "W" . "0".$weeknumber)
But it does not work for weeks starting in days other than Monday.