Home  >  Article  >  Backend Development  >  php process control else

php process control else

不言
不言Original
2018-05-04 09:25:491496browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn