Possible Duplicate:
How to get previous month and year relative to today, using strtotime and date?
Today is December, 31st but strtotime("-1 months")
returns December:
echo date("Y-m", strtotime("-1 months"));
Same for strtotime("last month")
How can I properly return the previous month (November)?
strtotime("first day of last month")
The first day of
is the important part as detailed on the Relative Formats manual page.
Example: http://codepad.viper-7.com/dB35q8 (with hard-coded today's date)