How to get current week in php?

QuestionsHow to get current week in php?
Robin Willson asked 3 years ago

You can get the current week dates using these simple code

<?php
$monday = strtotime(“last monday”);
$monday = date(‘w’, $monday)==date(‘w’) ? $monday+7*86400 : $monday;
$sunday = strtotime(date(“Y-m-d”,$monday).” +6 days”);
$current_week_sd = date(“Y-m-d”,$monday);
$current_week_ed = date(“Y-m-d”,$sunday);
?>