Home >Backend Development >PHP Tutorial >php?计算结束时间

php?计算结束时间

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-20 12:49:27878browse

<?php$StartDate=2015-07-17$day=20$EndDate=2015-08- 06       //平年和闰年  ,大月和小月//如何计算出这个结果???>


回复讨论(解决方案)

date函数就可以了啊

echo date('Y-m-d', strtotime('+20 day 2015-07-17'));

<?php$StartDate='2015-07-17';$StartTime = strtotime($StartDate);$day=20;$EndDate=date('Y-m-d', $StartTime + 20*24*3600); echo $EndDate;?>

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