title: Start and end time, split into 1 hour segments
body: <p>I have a start and end time in a <code>timestamp</code> format. I want to split these into timeslots of e.g 1 hour.</p>
  <pre><code>$t1 = strtotime('2010-05-06 12:00:00');
  $t2 = strtotime('2010-05-06 18:00:00');
  
  $timeslots = array();
  
  while ($t1 &lt; $t2) {
    $t1 = $t1 + 3600;
    $timeslots[] = $t1;
  }
  
  foreach ( $timeslots as $slot ) {
    echo date(&quot;Y-m-d H:i:s&quot;, $slot) . '&lt;br/&gt;';
  }
  </code></pre>
  <p>Is this the most efficient way to do it or is there a better, more versatile way to do this?</p>
  <p>Occasionally when trying it with other numbers for different length timeslots there was a Fatal error: Allowed memory size exhausted which makes me think it's not very efficient. Though that doesn't appear to be happening now...</p>
  <p>(I'm building a booking sytem)</p>