douhao123457 2019-04-26 22:51
浏览 44

当我尝试在IF语句中检查是否有多于1个参数时,代码将不再起作用...为什么?

I'm perplex about an IF statement I'm trying to make work. I need to check if the actual hour is in a range of numbers...

Example:

$currentTime=date('H', $dateToCheck);

if($currentTime<18 && $currentTime>7)
{
   do something;
}

The problem is that whenever I try to check the time with only one statement the IF will work but if I use "&&" and add another statement the IF won't work anymore.

(Of course both of the statement are true so the if should be executed)

The code I'm actually working on is the following

    $orarioMess=date('H',$queryDate);
    if($orarioMess<18 && $orarioMess>7)
    {
      $status=12;
      $checkStatus=1;
    }

I expect the IF still to be executed even with 2 statements to check. I have no clue why it isn't working...

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图
    • ¥15 stm32开发clion时遇到的编译问题
    • ¥15 lna设计 源简并电感型共源放大器