- time: documentation ( source)
- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$otime="12:00";
$ctime="23:00";
$open = strtotime(date("Y-m-d ").$otime);
$close = strtotime(date("Y-m-d ").$ctime);
If($close<$open) $close += 3600*24;
If(time() >= $open && time() < $close){
Echo "open";
}Else{
Echo "closed";
}