sample.php
//1ヶ月前
echo date('Y-m-d', strtotime("-1 month"));
//2016-10-16
//現在
echo date('Y-m-d', strtotime("now"));
echo date('Y-m-d', time());
//2016-11-16
//1ヶ月後
echo date('Y-m-d', strtotime("+1 month"));
//2016-12-16
こんな感じで +1 dayとか +1 yearとかいう書き方が通用する
yesterdayとかって書いてもいけちゃう。
ちなみにLaravelだったら、
sample.blade.php
{{ date('Y-m-d', strtotime("-1 month")) }}
こう書く。
日付扱う時にはこれ最強に便利。