Just had a need to to represent the end of the current week in PHP. A quick Google search turned up a bunch of clumsy ways. The most common was to run the current date and day of the week through some math to get the date of Next Friday.
Fortunately thinking of those last two words reminded me of an easier way, and one that I use in BASH occasionally. PHP’s strtotime function takes a similar language that GNU Date does. So to find out the date of next friday, just use this line of code:
$week_ending = date('Y-m-d', strtotime( 'Next Friday'));
You can also use “This Friday” which will return today’s date on a Friday instead of a week from today.