Home > Backend Development > PHP Tutorial > php get start date and end date of this week

php get start date and end date of this week

WBOY
Release: 2016-08-08 09:28:41
Original
1206 people have browsed it
$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"));
Copy after login

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.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template