fork(1) download
  1. <?php
  2.  
  3. $data_inicio = new DateTime("2018-02-08");
  4. $data_fim = new DateTime("2018-03-10");
  5. $dateInterval = $data_inicio->diff($data_fim);
  6. echo $dateInterval->days;
  7. $datas = array();
  8. for($i = $data_inicio; $i < $data_fim; $i = $data_inicio->add(new DateInterval('P1D')) )
  9. {
  10. $datas[] = $i->format("d/m/Y");
  11.  
  12. }
  13.  
  14. print_r($datas);
Success #stdin #stdout 0.03s 23788KB
stdin
Standard input is empty
stdout
30Array
(
    [0] => 08/02/2018
    [1] => 09/02/2018
    [2] => 10/02/2018
    [3] => 11/02/2018
    [4] => 12/02/2018
    [5] => 13/02/2018
    [6] => 14/02/2018
    [7] => 15/02/2018
    [8] => 16/02/2018
    [9] => 17/02/2018
    [10] => 18/02/2018
    [11] => 19/02/2018
    [12] => 20/02/2018
    [13] => 21/02/2018
    [14] => 22/02/2018
    [15] => 23/02/2018
    [16] => 24/02/2018
    [17] => 25/02/2018
    [18] => 26/02/2018
    [19] => 27/02/2018
    [20] => 28/02/2018
    [21] => 01/03/2018
    [22] => 02/03/2018
    [23] => 03/03/2018
    [24] => 04/03/2018
    [25] => 05/03/2018
    [26] => 06/03/2018
    [27] => 07/03/2018
    [28] => 08/03/2018
    [29] => 09/03/2018
)