title: Insert text depending on time of day and day of week
body: <p>I'm trying to piece together a php script to output different text depending on what day it is and the time of day.</p>
  
  <p><strong>Example:</strong>
  On weekdays (mon-fri), I would like to output text according to the following periods of time (24H, server time, UTC):
  00:00-08:00: "Lorem ipsum"
  08:00-13:00: "dolor sit amet"
  13:00-15:00: "Pellentesque habitant"
  15:00-15:30: "dolor sit amet"
  15:30-24:00: "Lorem ipsum"
  On weekends (sat-sun), I would like to output the following text in this time period:
  00:00-24:00 "Lorem ipsum"</p>
  
  <p>Can anyone help with a php script to do that?</p>
  
  <p>I've already gotten some help over at the <a href="http://css-tricks.com/forums/viewtopic.php?f=6&amp;t=7469&amp;p=29459#p29459" rel="nofollow noreferrer">css-tricks forum</a>. They supplied this code:</p>
  
  <pre><code>    &lt;?php
  $date = strtotime("now");
  $hour = date("H", $date);
  
  switch($hour) {
  case 00:
  case 01:
  case 02:
  case 03:
  case 04:
  case 05:
  case 06:
  case 07:
  case 08:
               $dets = array("img" =&gt; "image1.png", "txt" =&gt; "Lorem ipsum");
               break;
  case 09:
  case 10:
  case 11:
  case 12:
  case 13:
               $dets = array("img" =&gt; "image2.png", "txt" =&gt; "dolor sit amet");
               break;
  case 14:
  case 15:
  case 16:
               $dets = array("img" =&gt; "image3.png", "txt" =&gt; "Pellentesque habitant");
               break;
  case 17:
  case 18:
  case 19:
  case 20:
  case 21:
  case 22:
  case 23:
  case 24:
               $dets = array("img" =&gt; "image1.png", "txt" =&gt; "Lorem ipsum");
               break;
  }
  
  
  echo "&lt;img src='$dets[img]' alt='$dets[txt]' /&gt;";   
  ?&gt;
  </code></pre>
  
  <p>But it works for all days, and only in full hours. I want to be able to specify per half-hour and on a day to day basis.</p>
  
  <p>Still a php-noob so I'm hoping someone can help me.</p>