I need to get previous month and year, relative to current date.
However, see following example.
// Today is 2011-03-30 echo date(\'Y-m-d\', strtotim
if the day itself doesn't matter do this:
echo date('Y-m-d', strtotime(date('Y-m')." -1 month"));