title: PHP - Find next available time slot
body: <p>I'm looking for help in writing a script to find the next available time slot.</p>
  
  <p>Ex:  Person A wants an appointment and the available time slots everyday is 9am, 12pm, 4pm, 6pm, 9pm</p>
  
  <p>So, I need to check existing data and compare the time slots booked for the other appointments and then find next available.</p>
  
  <pre><code>$apts = array(
          'Person 1' =&gt; '1/1/09-9:00',
          'Person 2' =&gt; '1/1/09-12:00',
          'Person 3' =&gt; '1/1/09-18:00',
          'Person 4' =&gt; '1/1/09-21:00'
          );
  </code></pre>
  
  <p>So, I need to find next time slot for Person A against $apts, and it should come up with 4pm (1/1/09-16:00).  Then comes along Person B and the next time slot for him/her should be '1/2/09-9:00', since no more time slots on 1/1/09, so go to 9am next day.</p>
  
  <p>Make since?
  Thanks!!</p>