Any way to break if statement in PHP?

前端 未结 20 2025
無奈伤痛
無奈伤痛 2020-12-02 05:05

Is there any command in PHP to stop executing the current or parent if statement, same as break or break(1) for switch/

20条回答
  •  南方客
    南方客 (楼主)
    2020-12-02 05:34

    No.

    But how about:

    $a="test";
    if("test"==$a)
    {
      if ($someOtherCondition)
      {
        echo "yes";
      }
    }
    echo "finish";
    

提交回复
热议问题