There is the DatePeriod
class.
EXAMPLE:
$begin = new DateTime('2013-02-01');
$end = new DateTime('2013-02-13');
$daterange = new DatePeriod($begin, new DateInterval('P1D'), $end);
foreach($daterange as $date){
echo $date->format("Y-m-d") . "<br>";
}
(P1D stands for period of one day, see DateInterval
for further documentation)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…