【发布时间】:2012-07-20 09:55:57
【问题描述】:
我想得到上个月的年份。
例如在July 2012 我想要结果2012。
但是在January 2013 我想要结果2012
在Feb 2013 我想要结果2013
我已经搜索并找到了这个How to get previous month and year relative to today, using strtotime and date?
它使用date_create 函数(即DateTime 类)。但我想要一个不使用它的解决方案。即通过使用简单的date() 函数
【问题讨论】:
标签: php