Three forms of conditional statements: 1. if statement: the syntax is "if (condition) {execution statement}", if the condition is true, the statement is executed; 2. if-else statement: the syntax is " if (condition) {Execute statement 1} else {Execute statement 2}", if the condition is true, execute statement 1; otherwise, execute statement 2; 3, switch statement, etc.
The three forms of conditional statements are as follows:
if statement:
if-else statement:
switch statement:
The above are three common forms of conditional statements, each form has its specific usage scenarios and functions.
The above is the detailed content of What are the three forms of conditional statements?. For more information, please follow other related articles on the PHP Chinese website!