How to get previous month and year relative to today, using strtotime and date?

前端 未结 15 963
情书的邮戳
情书的邮戳 2020-11-28 07:48

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         


        
15条回答
  •  失恋的感觉
    2020-11-28 08:32

    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

提交回复
热议问题