how to subtract 2 months from current month? I have used this :


  $date = date("Y-m", strtotime("-2 months"));


and it is gives "2016-12" but what i needed is "2016-11".
If you try to change format to dmY for example: 
echo date("dmY", strtotime("-2 months"));
You will see that result is 01122016.

You can check comments from this question also:
https://stackoverflow.com/questions/10586615/current-date-2-months

And you can check solution here: https://stackoverflow.com/questions/9058523/php-date-and-strtotime-return-wrong-months-on-31st

Pass second parameter.