我想知道如何使用php来询问时间是否大于
08:30
并且低于
21:15
如果我使用:
<?php
if ( (date("H")>8&&date("i")>30) && (date("H")<21&&date("i")<25) ) {
echo 'This website is closed from 08:30 - 21:25. Sorry for the Inconvenience.';
exit;
}
?>
这不是一个准确的说法,因为即使时间大于 8 并且小于 21,这里也有一个分钟的验证......