This article mainly introduces else about PHP process control, which has a certain reference value. Now I share it with everyone. Friends in need can refer to it
This article is tried for the basicsLearners, experts please close this page
This article takes 3 minutes to read, it is difficult to understand
(PHP 4, PHP 5 , PHP 7)
It is often necessary to execute a statement when a certain condition is met, and execute other statements when the condition is not met. This is the function of else. else extends the if statement and can execute the statement when the value of the expression in the if statement isFALSE
. For example, the following code displaysa is bigger than bwhen is greater than , otherwise it displaysa is NOT bigger than b:
$b) { echo "可以执行"; } else { echo "不可以执行"; } ?>
elseThe expressions in theifandelseif(if any) statements have the valueonlyFALSE
is executed when
Related recommendations:
php process control if Statement
The above is the detailed content of php process control else. For more information, please follow other related articles on the PHP Chinese website!