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 i understand the question correctly you just want last month and the year it is in:
Here is the example: http://codepad.org/c99nVKG8