title: regular expression not working when check time in php
body: <p>below is my code for checking the variable is either time or not</p>
  
  <pre><code>function isTime($time) {
  
      if (preg_match("/^([1-2][0-3]|[01]?[1-9]):([0-5]?[0-9]):([0-5]?[0-9])$/", $time))
              {
          return true;
              echo "&lt;script&gt;alert('is a time');&lt;/script&gt;";
              }
           else {
              echo "&lt;script&gt;alert('not a time');&lt;/script&gt;";
             return false;
             }
           }
  </code></pre>
  
  <p>and this is expression fails when value like this <code>$time=00:08:33</code>, and working fine with time like <code>$time=01:08:33</code>, please modify this expression</p>