title: Get previous week date range php
body: <p>I need help getting the "this week" full date range in the following format: Y-m-d</p>
  
  <p>I have successfully been able to get "this month" full date range but not the "this week" full date range.</p>
  
  <p>This is my code for "this month":</p>
  
  <pre><code>//Functions for later use
  function firstOfMonth() {
      return date("Y-m-d", strtotime(date('m').'/01/'.date('Y').' 00:00:00'));
  }
  
  function lastOfMonth() {
      return date("Y-m-d", strtotime('-1 second',strtotime('+1 month',strtotime(date('m').'/01/'.date('Y').' 00:00:00'))));
  }
  
  //Setup the date_range variables
  $date_start = firstOfMonth();
  $date_end  = lastOfMonth();
  </code></pre>
  
  <p>Any help is greatly appreciated!</p>