Any way to break if statement in PHP?

前端 未结 20 2071
無奈伤痛
無奈伤痛 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

    To completely stop the rest of the script from running you can just do

    exit; //In place of break. The rest of the code will not execute

提交回复
热议问题