Concept

How are if, if-else, and if-else-if statements used in PHP?

ComputerScienceOne / Order of Precedence

"38.2. If, If-Else, If-Else-If Statements Conditional statements in PHP utilize the keywords if , else , and else if . Condi- tions are placed inside parentheses immediately after the if and else if keywords. Examples of all three can be found in Code Sample 38.1. Observe that the statement, if($x < 10) does not have a semicolon at the end. This is because it is a conditional statement that determines the flow of control and not an executable statement. Therefore, no semicolon is used. Suppose we made a mistake and did include a semicolon: 517"

Related Ideas

How are if, if-else, and if-else-if statements used in PHP? | ComputerScienceOne | Bifalgorithm | Bifalgorithm