danny

PHP根据小时段执行不同代码
是不是看起来很笨逼 <?php $d=date("H"); $d1=array("0","1","2",...
扫描右侧二维码阅读全文
12
2019/05

PHP根据小时段执行不同代码

是不是看起来很笨逼

<?php
$d=date("H");
$d1=array("0","1","2","3","4","5");
$d2=array("6","7","8","9","10","11");
$d3=array("12","13","14","15","16","17");
$d4=array("18","19","20","21","22","23");
if(in_array($d,$d1))
{
echo 'Match found';
}
elseif(in_array($d,$d2))
{
echo 'Match found2';
}
elseif(in_array($d,$d3))
{
echo 'Match found3';
}
elseif(in_array($d,$d4))
{
echo 'Match found4';
}
else
{
echo '0';
}
?>
Last modification:May 12th, 2019 at 11:45 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment