Home > Backend Development > PHP Tutorial > php process control else

php process control else

不言
Release: 2023-03-25 10:46:02
Original
1604 people have browsed it

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 "不可以执行";
}
?>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template