函数源代码:
---------------------------------------------
说明:若$vartime在今天的范围内,返回ture,否则返回false.
function btodaytotomorrow($vartime)
{
$nowyear=date("y");
$nowmonth=date("n");
$nowday=date("j");
$arytodayandtomorrow["today"]=date("u",mktime(0,0,0,$nowmonth,$nowday,$nowyear));
$arytodayandtomorrow["tomorrow"]=date("u",mktime(0,0,0,$nowmonth,($nowday+1),$nowyear));
if($vartime>=$arytodayandtomorrow["today"]&&$vartime<$arytodayandtomorrow["tomorrow"])
{
return true;
}
else
{
return false;
}
}
------------------
类似的你可以进行任意时间段的判断。
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!