PHP得到下一个月的当前时间的方便

时间:2019-01-22 09:01:46 类型:PHP
字号:    
办理周卡,月卡,年卡时经常需要得到结束的时间, 这里使用php的strtotime就会非常方便
//下个星期的现在
echo $w = strtotime("+1 week") . "<br/>";
//下个月的现在
echo $m = strtotime("+1 month") . "<br/>";
//下一年的现在
echo $y = strtotime("+1 year") . "<br/>";

总的来说, 把里面  1  换成变量, 就可以得到第 n 个星期,月, 年的时间了总的来说