Home > Article > Backend Development > php get start date and end date of this week
$sdefaultDate = date("Y-m-d"); $first=1; $w=date('w',strtotime($sdefaultDate)); $week_start=date('Y-m-d',strtotime("$sdefaultDate -".($w ? $w - $first : 6).' days')); $week_end=date('Y-m-d',strtotime("$week_start +6 days"));
The above introduces PHP to get the start date and end date of this week, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.