1 2 3 4 5 6 7 8
<? $date1 = strtotime('2009-01-01'); $date2 = strtotime('2010-01-01'); while ($date1 <= $date2) { echo date('Y-m-d', $date1) . "\n"; $date1 = strtotime('+1 month', $date1); }
1 2 3 4 5 6 7 8 9 10 11 12 13
2009-01-01 2009-02-01 2009-03-01 2009-04-01 2009-05-01 2009-06-01 2009-07-01 2009-08-01 2009-09-01 2009-10-01 2009-11-01 2009-12-01 2010-01-01