爲什麼此代碼無法按計劃運行?多次加入月份不起作用
代碼:
$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'格式的日期試過嗎? –
我需要它只給月 –