I\'m trying to subtract 1 month from a date.
$today = date(\'m-Y\');
This gives: 08-2016
How can I subtract a month to get 07
07
$currentMonth = date('m', time()); $currentDay = date('d',time()); $currentYear = date('Y',time()); $lastMonth = $currentMonth -1; $one_month_ago=mkdate(0,0,0,$one_month_ago,$currentDay,$currentYear);
This could be rewritten more elegantly, but it works for me