php 计算多少个月之后的日期

如题所述

    可以用date函数,配合strtotime函数使用

    代码如下

    //2016-08-10这天 2个月后的日期
    echo date("Y-m-d",strtotime("+2 month",strtotime("2016-08-10")));

    //当前 3个月后的日期
    echo date("Y-m-d",strtotime("+3 month",time()));

温馨提示:答案为网友推荐,仅供参考