title: PHP check if time falls within range, questioning common solution
body: <p>I have to check if the current daytime falls in a specific range. I looked up the internet and found several similar solutions like this one:</p>
  
  <pre><code>$now = date("His");//or date("H:i:s")
  
  $start = '130000';//or '13:00:00'
  $end = '170000';//or '17:00:00'
  
  if($now &gt;= $start &amp;&amp; $now &lt;= $end){
  echo "Time in between";
  }
  else{
  echo "Time outside constraints";
  }
  </code></pre>
  
  <p>If both conditions have to be true, how can this bis achieved when we assume that $start is 06:00:00 and $end is 02:00:00.</p>
  
  <p>If we make the assumption that it is 01:00:00, in this case the first condition can't be true.</p>
  
  <p>Has anybody an idea to handle this problem differently?</p>
  
  <p>Thanks!</p>