Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Can be done with DateInterval
$begin = new DateTime('2016-02-03'); // Начальная дата
$end = new DateTime('2016-03-09'); // Конечная дата
$interval = DateInterval::createFromDateString( '1 day' );
$period = new DatePeriod( $begin, $interval, $end );
foreach ( $period as $dt ) {
echo $dt->format( "Y-m-d" ); //$dt - Datetime
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question