In php i can get today date/day by using : $today = date(‘D, Y-m-d’);
If today is wednesday 8 july, i want to display data from 6 – 11 July (9, 10 and 11 will be blank). How do I do that?
Now my system is like, today is 8 July, i will display 2 – 8 july, but start on wednesday. Not very like this way. I prefer, start on Monday to sunday, then have previous and next week button.
Use simple
strtotime()to easy calculate the date of last monday.Be sure to check if today is not monday, because in that case it will return a date week earlier.