title: get start and end date of month by week number of the month in php
body: <p>How do I compute the start and end date of a week by month, year, and week number?  The year is a 4-digit integer, such as 2016; the month is an integer, range 1-12; the week is an integer in the range 1-5.</p>
  
  <p>I already have this code block:</p>
  
  <pre><code>function getStartAndEndDate($week, $year) 
  {
      $time = strtotime("1 $year", time());
      $day = date('w', $time);
      $time += ((7 * $week) + 1 - $day) * 24 * 3600;
      $return[0] = date('Y-n-j', $time);
      $time += 6 * 24 * 3600;
      $return[1] = date('Y-n-j', $time);
      return $return;
  }
  </code></pre>
  
  <p>How can I use or rewrite this function?</p>