title: PHP create range of dates
body: <p>Starting with a date in this format: <code>2011-05-01 09:00:00</code>, how can I create an array that contains all office hours (09:00 to 17:00) for all working days of the year (so excluding all Saturday and Sundays). What I want to arrive to is something like this:</p>
  
  <pre><code>2011-05-01 09:00:00
  2011-05-01 10:00:00
  2011-05-01 11:00:00
  2011-05-01 12:00:00
  2011-05-01 13:00:00
  2011-05-01 14:00:00
  2011-05-01 15:00:00
  2011-05-01 16:00:00
  2011-05-01 17:00:00
  //next day, starting at 09:00 and ending at 17:00
  2011-05-02 09:00:00
  ...
  2011-05-02 17:00:00
  //until the last day of the year from 09:00 to 17:00
  2011-12-31 09:00:00
  ...
  2011-12-31 17:00:00
  </code></pre>
  
  <p>The start date will be the first of the current month at with 09:00 as time and the very last date (last element of the array) will always be 17:00 on the last day of the year.</p>
  
  <p>Again, weekends should be excluded. </p>
  
  <p><strong>Pseudocode idea:</strong>
  I thought of something like <code>strtotime($start, "+1 one hour")</code> with a check for <code>"if smaller than 17:00"</code> but it doesn't seem to be that simple.</p>