1date('w'); //gets day of week as number(0=sunday,1=monday...,6=sat)
2
3//note:returns 0 through 6 but as string so to check if monday do this:
4if(date('w') == 1){
5 echo "its monday baby";
6}
1<?php
2 $week=29;
3 $year=2017;
4
5 function getStartAndEndDate($week, $year)
6 {
7 $dateTime = new DateTime();
8 $dateTime->setISODate($year, $week);
9 $result['start_date'] = $dateTime->format('d-M-Y');
10 $dateTime->modify('+6 days');
11 $result['end_date'] = $dateTime->format('d-M-Y');
12 return $result;
13 }
14
15 $dates=getStartAndEndDate($week,$year);
16 print_r($dates);
17
18?>