Home > Backend Development > PHP Tutorial > Judge the 'new' function: get the seconds of today and tomorrow_PHP tutorial

Judge the 'new' function: get the seconds of today and tomorrow_PHP tutorial

WBOY
Release: 2016-07-21 16:05:43
Original
1049 people have browsed it

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

TechArticleIf you want to judge 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: -------...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template