0

Possible Duplicate:
Get first day of week in PHP?

I want to have the first day of the week if I give any date and it works for all dates except Mondays as it gives me the previous Monday, not this Monday.

My code:

$beginweek = strtotime('last Monday', $timestamp); //$timestamp = a given date
Community
  • 1
  • 1
Kevin
  • 321
  • 4
  • 21
  • There are [several different implementations here](http://stackoverflow.com/questions/1897727/get-first-day-of-week-in-php) Basically, you just need to determine if today is Monday, and if it isn't, use the code you have. – Michael Berkowski Jan 30 '13 at 14:21

1 Answers1

1

You need to write a condition to see if the current day is monday, else use 'last Monday'

CrayonViolent
  • 32,111
  • 5
  • 56
  • 79