Beware... simply adding or substracting one month on a yyyy-mm
string may render unexpected results under some edge cases.
It happens that I use that format on a site I built (for payrolls and other stuff) and when the calculation was done on February 28 (IIRC) and other edge cases, the result wasn't always what I needed it to be (i.e., the next or previous month)
It's a little bit more code, but my advice would be:
$first_of_month = date('Y-m-01', strtotime($payroll['month']));
$newdate = date('Y-m', strtotime($first_of_month."-1 month"));
By forcing your initial value to be a full Y-m-d date on the first day of the month (the day being irrelevant for you, as it's used only for the calculation) you can make sure that the calculation will be correct every time