title: PHP - Create a list of times, with those times where an event is scheduled are given a different class
body: <p>I would like to create a list of times, in table form, from 9am to 9pm, in 30-minute intervals.  For each of those intervals where I have an event scheduled, I'd like the cell to be red, and for those where the room is free, I'd like them to be green.</p>
  
  <p>So far, I've only been able to list the times where the room is in use, but I need to fill in with the available times in green boxes.  Here's my code so far.  :</p>
  
  <pre><code>foreach ($events[$event_day] as $event) {
  
      $meetstatus = $event['status'];
      $start = $event['time1'];
      $end = $event['time2'];
  
      $tStart = strtotime($start);
      $tEnd = strtotime($end);
      $tNow = $tStart;
      if ($event['roomchoice'] == 'Meeting Room') {
          while ($tNow &lt;= $tEnd) {
              $time = date("H:iA", $tNow) . "\n";
              $calendar .= '&lt;tr&gt;&lt;td class="meeting-' . $meetstatus . '"&gt;' . $time . '&lt;/td&gt;&lt;/tr&gt;';
              $tNow = strtotime('+30 minutes', $tNow);
          }
      }
  }
  </code></pre>