Home  >  Article  >  Backend Development  >  PHP取得指定日期的 星期的开始时间 结束时间

PHP取得指定日期的 星期的开始时间 结束时间

WBOY
WBOYOriginal
2016-06-13 13:11:53794browse

PHP获得指定日期的 星期的开始时间 结束时间

$time= date("Y-m-d H:i:s");
echo('你输入的时间是:'.$time.'');
$lastday=date("Y-m-d",strtotime("$time Sunday"));
echo('输入的时间星期第一天是:'.date("Y-m-d",strtotime("$lastday - 6 days")).'<br>');
echo('输入的时间星期最后一天是:'.$lastday);
Statement:
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