開始日と終了日の間にある月ごとに同じ日が必要です。その日の月が特定の月に有効でない場合は、その月の最終日が必要です。スクリプトはありますか?やったことは。
$startdate='2010-01-30';
$enddate='2011-01-30';
while ($startdate <= $enddate)
{
echo date('Y-m-d', $startdate ) . "\n";
$startdate = strtotime('+1 month', $startdate);/// for case of feb 28 days last date it should disply as it skips it
}
予想される出力: 入力の場合$startdate='2012-01-30'; $enddate='2013-12-30'
、結果は次のようになります ==>
_2012-12-30_
2013-01-30
**2013-02-28**
2013-03-30
2013-04-30
2013-05-30
2013-06-30
2013-07-30
2013-08-30
2013-09-30
2013-10-30
2013-11-30
_2013-12-30_