I think this is what you want.
$dayofweek = date('w', strtotime($date));
$result = date('Y-m-d', strtotime(($day - $dayofweek).' day', strtotime($date)));
More Related Contents:
- PHP store hours, closed dates [closed]
- Getting error in coding PHP [closed]
- PHP 01/01/1970 Issues with Date Fields
- Convert one date format into another in PHP
- PHP How to find the time elapsed since a date time? [duplicate]
- Convert seconds into days, hours, minutes and seconds
- Converting string to Date and DateTime
- I have 2 dates in PHP, how can I run a foreach loop to go through all of those days?
- PHP get number of week for month
- Getting date format m-d-Y H:i:s.u from milliseconds
- Convert number to month name in PHP
- The first day of the current month in php using date_modify as DateTime object
- Adding minutes to date time in PHP
- Elegant way to get the count of months between two dates?
- PHP: Adding months to a date, while not exceeding the last day of the month
- Calculate age based on date of birth
- php date validation
- Send PHP date to JavaScript date format
- get next and previous day with PHP
- how to re-format datetime string in php?
- how to convert php date formats to GMT and vice versa?
- Getting last month’s date in php
- change the date format in laravel view page [duplicate]
- Calculate the number of months between two dates in PHP?
- Date minus 1 year?
- How to display a date as iso 8601 format with PHP
- Date in a URL dd/mm/yyyy
- Format date from database?
- Converting to date in PHP from yyyymmdd format
- Validate date format in php