fork download
  1. <?php
  2.  
  3. $data_inicio = new DateTime('2017-01-02');
  4. $data_fim = new DateTime('2017-01-09');
  5.  
  6. $interval = new DateInterval("P1D");
  7.  
  8. for ($i = $data_inicio; $i <= $data_fim; $i->add($interval))
  9. {
  10. echo $i->format("Y-m-d") . PHP_EOL;
  11. }
Success #stdin #stdout 0.01s 83904KB
stdin
Standard input is empty
stdout
2017-01-02
2017-01-03
2017-01-04
2017-01-05
2017-01-06
2017-01-07
2017-01-08
2017-01-09