fork download
  1. <?php
  2.  
  3. $periodo = new \DatePeriod(
  4. new \DateTime('2018-02-08'),
  5. new \DateInterval('P1D'),
  6. new \DateTime('2018-03-10')
  7. );
  8.  
  9. foreach ($periodo as $key => $value) {
  10. print_r($value->format('d-m-Y'));
  11. echo " , ";
  12. }
Success #stdin #stdout 0.03s 23564KB
stdin
Standard input is empty
stdout
08-02-2018 , 09-02-2018 , 10-02-2018 , 11-02-2018 , 12-02-2018 , 13-02-2018 , 14-02-2018 , 15-02-2018 , 16-02-2018 , 17-02-2018 , 18-02-2018 , 19-02-2018 , 20-02-2018 , 21-02-2018 , 22-02-2018 , 23-02-2018 , 24-02-2018 , 25-02-2018 , 26-02-2018 , 27-02-2018 , 28-02-2018 , 01-03-2018 , 02-03-2018 , 03-03-2018 , 04-03-2018 , 05-03-2018 , 06-03-2018 , 07-03-2018 , 08-03-2018 , 09-03-2018 ,