I want to get first date of +2 months of given date,Iam using below function to get this .
$date = '2015-12-31';
echo $date = date('1-m-Y', strtotime('+2 month', strtotime($date)));
This was working fine.But for december 30,31 this is not giving result as expected.for date 2015-12-30
it gives result '1-03-2016'
.I know because of february having 29 days this gives this result.But expected result is '01-02-2016'
. This can be solved by writing new function.But i want to go with built in functions.Please Help.