what's wrong with this code? I want to add empty value when the timing is between 5 AM to 10 AM. I tried below code but not working.
if(date('H')=='05' && date('H')<'10')
{
$san="";
}
CodePudding user response:
Maybe you mean >=
? the first condition has ==
in your code
if(date('H') >= 5 && date('H') < 10)
{
$san="";
}
CodePudding user response:
Can you try this
$currentDateHour = date('G');
if(in_array($currentDateHour, range(5,10)))
{
$san="";
}
This following if
statment will true between 05:00:00
and 10:59:59