title: get startdate and enddate for current quarter php
body: <p>I am trying to set a start date and end date by the quarter.</p>
  
  <p>For example, I am working on a reporting system where i need to report data for quarter 1, quarter 2, quarter 3, and quarter 4.</p>
  
  <p>Quarter One - January - March</p>
  
  <p>Quarter Two - April - June</p>
  
  <p>Quarter Three - July - September</p>
  
  <p>Quarter Four - October - December</p>
  
  <p>I have for example some cases for the current month, and the previous month as shown below.</p>
  
  <pre><code>   case 'this_month':
        $start_date = date(DATE_FORMAT, mktime(0, 0, 0, date("m"), 1, date("Y")));
        $end_date = date(DATE_FORMAT, mktime(0, 0, 0, date("m"), date("d"), date("Y")));
      break;
      case 'last_month':
        $start_date = date(DATE_FORMAT, mktime(0, 0, 0, date("m") - 1, 1, date("Y")));
        $end_date = date(DATE_FORMAT, mktime(0, 0, 0, date("m"), 0, date("Y")));
      break;
  </code></pre>
  
  <p>But now i need to add cases for <strong>this and last quarter</strong> and I am not sure how to actually do that so it reflects the proper quarter range.</p>
  
  <p>Any Ideas?</p>