PHP中如何给日期加上一个月/天

使用php的strtotime
实例:比如现在时间是“2017-07-06”,加一个月。

echo   date("Y-m-d", strtotime("+1 months", strtotime("2017-07-06")));
<?php
echo(strtotime("now"));
echo(strtotime("3 October 2005"));
echo(strtotime("+5 hours"));
echo(strtotime("+1 week"));
echo(strtotime("+1 week 3 days 7 hours 5 seconds"));
echo(strtotime("next Monday"));
echo(strtotime("last Sunday"));
?>
print_r(date('Y-m-d H:i:s',strtotime("+1 month")));
原文地址:https://www.cnblogs.com/phpper/p/7210632.html