如何在当前日期添加+6个月


How To Add +6 Months in current date

我想在当前日期中添加6个月。我使用了以下日期格式。

$current_time = date('Y-m-d');  

我已经继续使用下面显示的方法,但出现了一个错误。

"遇到格式不正确的数值"。并打印此值
[expiring_plan_date] => 1970-01-02

$data['PlanPayment']['expiring_plan_date'] = date
                                           (
                                            "Y-m-d", 
                                            strtotime("+6 month", $current_time)
                                           ); 

请帮忙。。

strtotime 中删除逗号

$data['PlanPayment']['expiring_plan_date'] = date("Y-m-d", strtotime("+6 month $current_time));