In php, if else or switch statements are used most frequently, next, I will give you a detailed introduction to my notes on using the if else Conditional Control statement in php. if you need it, please refer to it.
In php, the basic process control
Before you introduce the "if" statement, know that the "if" statement is to meet the expression when the execution of a PHP statement, when the condition is not satisfied, is not executed, but, in most cases, always meet the conditions when the
Use of case, simple case functionA simple case expression that uses an expression to determine the return value.
Grammar:
Case Search_expression
When Expression1 THEN RESULT1
When Expression2 THEN result2
...
When Expressionn THEN Resultn
ELSE
Unlike Java, PHP and other languages, the process control of SH is not NULL, such as:
Copy Code code as follows:
if (Isset ($_get["Q"])) {
Search (q);
}
else {
Doing nothing
}
?>
You can't write this in Sh/bash,
For the use of case, the simple case function is a simple case expression that uses an expression to determine the return value.Grammar:Case Search_expressionWhen Expression1 then RESULT1When Expression2 then RESULT2...When Expressionn then
In all programming languages, such as C language. JAVA and so on, all have the existence of if statements, of course, also include PHP. The if statement is used to select and execute different code snippets according to the conditions.
If statement
When programming, you often need to check a series of conditions and decide what measures to take accordingly. In Python, the if statement enables us to check the current state of the program and take corresponding measures accordingly. 5.1 The
Php process control statement. Php process control statements conditional control statements and cyclic control statements are two basic syntax structures. They are all used to control the program execution process and constitute the main syntax
Joe Brockmeier briefly introduces the PHP scripting language, discusses the origin, performance, and application Platform of PHP. A simple example of a PHP script illustrates its basic syntax and usage.
If you are working on web-based development,
Does PHP use this method to reference the variables in if to else? For example, thank you ------ solution -------------------- do not understand what you mean ------ solution ------------------ PHPcode $ test1; if ($ test) {$ test2;} else {# Here I
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.