title: Determine If Business Is Open/Closed Based On Business Hours
body: <p>My code works fine if the times are AM to PM (Ex: 11 AM - 10 PM), but if the locations hours of operation are AM to AM (Ex: 9 AM - 1 AM) it breaks. Here is my code:</p>
  
  <pre><code>$datedivide = explode(" - ", $day['hours']); //$day['hours'] Example 11:00 AM - 10:00 PM
  $from = ''.$day['days'].' '.$datedivide[0].'';
  $to = ''.$day['days'].' '.$datedivide[1].'';
  $date = date('l g:i A');
  $date = is_int($date) ? $date : strtotime($date);
  $from = is_int($from) ? $from : strtotime($from);
  $to = is_int($to) ? $to : strtotime($to);
  if (($date &gt; $from) &amp;&amp; ($date &lt; $to) &amp;&amp; ($dateh != 'Closed')) {
      ?&gt;
      &lt;script type="text/javascript"&gt;
      $(document).ready(function(){
          $('.entry-title-container').append('&lt;div class="column two"&gt;&lt;h2 style="color:green;text-align: left;margin: 0;"&gt;OPEN&lt;br /&gt;&lt;span style="color:#222;font-size:12px;display: block;"&gt;Closes at &lt;?php echo $datedivide[1]; ?&gt;&lt;/span&gt;&lt;/h2&gt;&lt;/div&gt;&lt;br clear="all" /&gt;');
      });
      &lt;/script&gt;
      &lt;?php
  }
  </code></pre>