I know that I have a question like this, but I don’t know if I am blind or what, but I can’t find an answer that fits my question, so here it is.
I have 2 combobox - month and year , I need a function that brings me the week number from the month and year that I selected.
example:
i select the date 02/2012 (m / yyyy), and the combo will display the weeks that belong to the month that I choose. ( weeks from a year ).
weeks:
5, 6, 7, 8, 9
My main goal is to pass the week number to another function in order to get the day that this week has, for example, returning this function:
$week_number = 40; $year = 2012; if($week_number < 10){ $week_number = "0".$week_number; } for($day=1; $day<=7; $day++) { echo date('m/d/Y', strtotime($year."W".$week_number.$day))."<br/>"; }
I don’t know if I can make my clear, but, any question of my guest.
Thanks.
summary:
52 weeks a year
if I select month 2, the function should return 5, 6, 7, 8, 9 .
source share