title: Display text based on time of day PHP
body: <p>I'm using the following code to show opening and closing times throughout the week however on a Tuesday the time to open is at 10:30. It seems to want to sit at 10 or 11. I've tried 10.5 in the PHP variable, but that's not making a change. Any suggestions?   </p>
  
  <pre><code>&lt;?php
  date_default_timezone_set('Europe/London'); // set it to the right value
  
  $weAreOpen = areWeOpen(date('l'), date('G'));
  
  if($weAreOpen) {
  echo 'We are open for business';
  } else {
  echo 'We are closed';
  }
  
  /**
   * Test if we're open for business
   * @param string $day - day of week (ex: Monday)
   * @param string $hour - hour of day (ex: 9)
   * @return bool - true if open interval 
   */
  function areWeOpen($day, $hour) {
  $hour = (int)$hour;
  switch($day) {
      case 'Monday':
          if($hour &gt;= 9 &amp;&amp; $hour &lt; 21) {
              return true;
          }
          break;
      case 'Tuesday':
          if($hour &gt;= 9 &amp;&amp; $hour &lt; 21) {
              return true;
          }
          break;
      case 'Wednesday':
          if($hour &gt;= 9 &amp;&amp; $hour &lt; 21) {
              return true;
              }
          break;
      case 'Thursday':
          if($hour &gt;= 9 &amp;&amp; $hour &lt; 21) {
              return true;
                  }
              break;
      case 'Friday':
          if($hour &gt;= 9 &amp;&amp; $hour &lt; 21) {
              return true;
          }
          break;
      case 'Saturday':
          if($hour &gt;= 9 &amp;&amp; $hour &lt; 21) {
              return true;
          }
          break;
      case 'Sunday':
          if($hour &gt;= 10 &amp;&amp; $hour &lt; 16) {
              return true;
          }
          break;
  }
  return false;
  }
  
  ?&gt;
  </code></pre>