title: Dates according to the number of days
body: <p>I want to classify the dates according to the number of days to have for example: every 1 of the dates, every two, and so on.</p>
  
  <pre><code>&lt;?php
  
  $date1= strtotime('2019-09-01');
  $date2= strtotime('2020-06-30'); 
  
  $nbjour=($date2-$date1)/60/60/24;
  
  for($i=0; $i &lt;= $nbjour; $i++) {
  
      setlocale(LC_TIME, "fr_FR");
      $day = strftime('%A',$date1);
  
           if ($day === 'Dimanche' || $day === 'Samedi') {
                    $date = strftime('%A %d %B %G',$date1). ' weekend';
              }
              else{
                    $date = strftime('%A %d %B %G',$date1);
              }
       echo $date;
       $date1+=60*60*24; 
       echo'&lt;br /&gt;' ;
   }
  </code></pre>
  
  <p>I want to get this result</p>
  
  <pre><code>[01-09-2019
  01-10-2019
  01-12-2019
  ...
  02-09-2019
  02-10-2019
  ...
  03-09-2019]
  </code></pre>