【发布时间】:2012-05-31 17:28:41
【问题描述】:
我有这段代码,它会输出一些我认为奇怪的东西。所以,我在这里做错了什么。
<?php
$sP1 = date('m Y');
$sP2 = date('m Y', strtotime('+01 month'));
$sP3 = date('m Y', strtotime('+02 month'));
$sP4 = date('m Y', strtotime('+03 month'));
echo $sP1.'<br>';
echo $sP2.'<br>';
echo $sP3.'<br>';
echo $sP4.'<br>';
?>
这个输出
05 2012
07 2012
07 2012
08 2012
我认为第二个应该是
06 2012
有人知道解决办法吗?
【问题讨论】:
-
查看这个问题的公认答案:stackoverflow.com/questions/9058523/…