Well,this seems strange. Please bear with me. Someone asked this question in SO. He wants the date of previous Monday. So i suggested
$monday=date(Y-m-d,strtotime('Monday this week'))
The output was perfect in my localhost. It showed 2012-07-30
. Another guy commented that the function i mentioned isn't working. It is giving the same date like
$monday=date(Y-m-d,strtotime('Monday'))
i.e., 2012-08-06
. And he isn't lying! The online editor which he linked is showing next monday's date. Check this! Why is this happening??
I searched, but couldn't get the reason behind it. Is it because of the older versions of php? Any help will be greatly appreciated. Thank you