为什么此代码无法按计划运行?多次加入月份不起作用
代码:
$regDate = '2016-10-03';
echo $date1 = date('m', strtotime('+4 month', strtotime($regDate))); echo '<br>';
echo $date2 = date('m', strtotime('+4 month', strtotime($date1))); echo '<br>';
echo $date3 = date('m', strtotime('+4 month', strtotime($date2))); echo '<br>';
echo $date4 = date('m', strtotime('+4 month', strtotime($date3))); echo '<br>';
我回来:
你有没有使用'YYYY-MM-DD'格式的日期试过吗? –
我需要它只给月 –