php 判断白天黑夜

<?php
$h=date('H');
if($h>=8 && $h<=20)
echo '白天';
else
echo '夜晚';
?>
原文地址:https://www.cnblogs.com/hellowzd/p/5222935.html