title: How to get every specific days of week within given date range in PHP?
body: <p>This give me every monday date in date range. </p>
  
  <p><strong>Question: How to get every monday and friday of week?</strong></p>
  
  <pre><code>$start_date = date('Y-m-d');
  $end_date = date('Y-m-d', strtotime($start_date . ' + 1 MONTH'));
  
  for(
      $i = strtotime('Monday', strtotime($start_date)); 
      $i &lt;= strtotime($end_date); 
      $i = strtotime('+1 WEEK', $i)
  ) {
      echo date('Y-m-d', $i). '&lt;br&gt;';
  }
  </code></pre>
  
  <p><strong>My Update:</strong></p>
  
  <pre><code>$my_dates = [];
  for(
      $i = strtotime($start_date); 
      $i &lt;= strtotime($end_date); 
      $i = strtotime('+1 DAY', $i)
  ) {
      if(in_array(date('N', $i), array(1, 5))) {
          $my_dates[] = date('Y-m-d', $i);
      }
  }
  
  var_dump($my_dates);
  </code></pre>