If you want to determine whether a certain time value (expressed in seconds) is within today's range based on time. The following function will help you make judgments easily.
Function source code:
---------------------------------------- -----
Note: If $varTime is within today's range, return true, otherwise return 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
; Judgment at any time period.
http://www.bkjia.com/PHPjc/315596.html
www.bkjia.com
true