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 basics Learners, 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 is FALSE
. For example, the following code displays a is bigger than b when is greater than , otherwise it displays a is NOT bigger than b:
<?php if ($a > $b) { echo "可以执行"; } else { echo "不可以执行"; } ?>
else The expressions in the if and elseif (if any) statements have the value only FALSE
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!