我将如何在 php 中的给定月份和年份度过未来的月份

how will i take future months by the given month and year in php

 INSERT:<input type="text" name="my">
    no of months:<input type="text" name="noofmonths">
<input type="submit" name="sub" value="submit">

点击提交按钮后我想要相应的未来month/year。

Eg:INSERT: Septemeber 2015;
no of months:4;

i want an o/p:January 2016;

另一个例子:

Eg:INSERT: December 2015;
no of months:2;

i want an o/p:February 2016;

你可以试试这个代码

假设用户输入这个日期

$date = "20 September";  //Your spelling for September is wrong make sure user enter correct spelling

用户输入 4 个月

echo $effectiveDate = date('F Y', strtotime("+4 months", strtotime($date)));