title: Get multiple PHP date periods from a range of dates
body: <p>I have an array of dates like this:</p>
  
  <pre><code>[Room 01 - DBL] =&gt; Array
              (
                  [0] =&gt; Mon 23-06-2014
                  [1] =&gt; Tue 24-06-2014
                  [2] =&gt; Wed 25-06-2014
                  [3] =&gt; Sat 28-06-2014
                  [4] =&gt; Sun 29-06-2014
              )
  
          [Room 02 - TWN] =&gt; Array
              (
                  [0] =&gt; Tue 24-06-2014
                  [1] =&gt; Wed 25-06-2014
                  [2] =&gt; Sat 28-06-2014
                  [3] =&gt; Sun 29-06-2014
              )
  </code></pre>
  
  <p>You can see that neither room has the date for the thursday or friday.  I want to be able to create a date range (either a DateTime Interval object or not - don't mind) for each group of dates.  So Room 02 - TWN should give me two date periods - one for Tue-Wed and another for Sat-Sun.  How would I go about this?  I know how to make a single date time period using the first and last items in the array but don't know how to detect if there is a gap...</p>