• Welcome to Journal web site.

我是 PHP 程序员

- 开发无止境 -

Next
Prev

php获取下个月或者上个月 月份_梦到韩大厨的博客_php获取上月月份

Data: 2016-05-13 02:33:30Form: JournalClick: 9

 获取上一个月的月份
  $i = 1;
  $month3 = date( 'Y-m', strtotime( 'last day of -'.$i.' months' ) );
获取下一个月的月份
$i = 1;
$month3 = date( 'Y-m', strtotime( 'last day of +'.$i.' months' ) );
确保这个月的天数比下个月天数多的情况下 最后一天 也能正确的获取到
Name:
<提交>