First, If...else statement
If...else statement
Executes a piece of code when the condition is set, and executes another piece of code when the condition is not established
Grammar:
1. Simple condition
if (condition) {
......
}
else{
......
First, If...else statement
If...else statement
Executes a piece of code when the condition is set, and executes another piece of code when the condition is not established
Grammar:
1. Simple condition
if (condition) {......}else{......}
Cases
1, if statement
An If statement is an important feature in most languages, and it executes the program segment according to the conditions. PHP's If statement is similar to C:
if (expr)
Statement
As discussed in an expression, expr is computed
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
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,
PHP ElseIf and else if difference
If, ElseIf, and ELSE statements are used to perform different actions based on different conditions.
Conditional statementWhen you write code, you often need to perform different actions for different
In PHP, conditional statements mainly use statements such as if else and if ElseIf and Swicth case, which are used to the most.
One, if...else statements
If...else statements
Executes a piece of code when the condition is established, and executes
Introduction to alternative syntax in PHP and introduction to alternative syntax in PHP. Introduction to alternative syntax in PHP. Introduction to alternative syntax in PHP today I checked the wordpress code, which contains some rare Alternative
PHP If ... Else Simple Tutorial
, if ElseIf's reports and other PHP are used to perform different actions, depending on the conditions.-------------------------------------------------- ------------------------------Conditional statementOften
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.