我有这个 PHP 代码:
$end=date('Y-m-d');
我用它来获取当前日期,我需要 5 年后的日期,例如:
$end=date('(Y + 5)-m-d');
我该怎么做?
最佳答案
尝试:
$end = date('Y-m-d', strtotime('+5 years'));
关于PHP 日期将 5 年添加到当前日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18269556/