title: Get date for monday and friday for the current week (PHP)
body: <p>How can I get the date for monday and friday for the current week? </p>
  
  <p>I have the following code, but it fails if current day is sunday or saturday.</p>
  
  <pre><code>$current_day = date("N");
  $days_to_friday = 5 - $current_day;
  $days_from_monday = $current_day - 1;
  $monday = date("Y-m-d", strtotime("- {$days_from_monday} Days"));
  $friday = date("Y-m-d", strtotime("+ {$days_to_friday} Days"));
  </code></pre>