fork download
  1. <?php
  2.  
  3. $data_inicio = new DateTime("08-02-2018");
  4. $data_fim = new DateTime("10-04-2018");
  5. $dateInterval = $data_inicio->diff($data_fim);
  6.  
  7.  
  8. for ($i = 1; $i < $dateInterval->days; $i++) {
  9. $interval = date_interval_create_from_date_string("+1 days");
  10.  
  11. echo $data_inicio->add($interval)
  12. ->format("d/M/Y"), PHP_EOL;
  13. }
Success #stdin #stdout 0.03s 24124KB
stdin
Standard input is empty
stdout
09/Feb/2018
10/Feb/2018
11/Feb/2018
12/Feb/2018
13/Feb/2018
14/Feb/2018
15/Feb/2018
16/Feb/2018
17/Feb/2018
18/Feb/2018
19/Feb/2018
20/Feb/2018
21/Feb/2018
22/Feb/2018
23/Feb/2018
24/Feb/2018
25/Feb/2018
26/Feb/2018
27/Feb/2018
28/Feb/2018
01/Mar/2018
02/Mar/2018
03/Mar/2018
04/Mar/2018
05/Mar/2018
06/Mar/2018
07/Mar/2018
08/Mar/2018
09/Mar/2018
10/Mar/2018
11/Mar/2018
12/Mar/2018
13/Mar/2018
14/Mar/2018
15/Mar/2018
16/Mar/2018
17/Mar/2018
18/Mar/2018
19/Mar/2018
20/Mar/2018
21/Mar/2018
22/Mar/2018
23/Mar/2018
24/Mar/2018
25/Mar/2018
26/Mar/2018
27/Mar/2018
28/Mar/2018
29/Mar/2018
30/Mar/2018
31/Mar/2018
01/Apr/2018
02/Apr/2018
03/Apr/2018
04/Apr/2018
05/Apr/2018
06/Apr/2018
07/Apr/2018
08/Apr/2018
09/Apr/2018