title: how to get sunday date between two date
body: <p>I try this </p>
  
  <pre><code>&lt;?php
      $startdate = '2016-07-15';
      $enddate = '2016-07-17';
      $sundays = [];
      $startweek=date("W",strtotime($startdate));
      $endweek=date("W",strtotime($enddate));
      $year=date("Y",strtotime($startdate));
  
      for($i=$startweek;$i&lt;=$endweek;$i++) {
          $result=$this-&gt;getWeek($i,$year);
          if($result&gt;$startdate &amp;&amp; $result&lt;$enddate) {
              $sundays[] = $result;
          }
      }
      print_r($sundays);
  
      public function getWeek($week, $year)
      {
         $dto = new \DateTime();
         $result = $dto-&gt;setISODate($year, $week, 0)-&gt;format('Y-m-d');
         return $result;
      }
  ?&gt;
  </code></pre>
  
  <p>this return blank array. but in between two dates <code>2016-07-17</code> is Sunday.</p>
  
  <p>I get output as <code>2016-07-17</code></p>
  
  <p>I refer this <a href="https://stackoverflow.com/questions/15886166/calculate-sundays-between-two-dates">here</a>
  But in this link return output as no of sunday not date.</p>