title: Create date ranges from single dates
body: <p>I have a database that is filled with single dates, for example: </p>
  
  <pre><code>date
  ----------
  2017-11-01
  2017-11-02
  2017-11-03
  2017-11-04
  2017-11-05
  2017-11-06
  2017-12-14
  2017-12-15
  2017-12-16
  2017-12-17
  2018-01-04
  </code></pre>
  
  <p>I need a way to output these values as date ranges using PHP. Using the example dates, my expected result should be like this: </p>
  
  <pre><code>2017-11-01 - 2017-11-06
  2017-12-14 - 2017-12-17
  2018-01-04 - 2018-01-04
  </code></pre>
  
  <p>Have anyone done this before, or know the best way to accomplish this? </p>
  
  <p>Thank you!</p>