Conditions

Example 1:

3 is odd.


Example 2:

3 is less than 8


PHP Case:

i equals 2

Definitions:

Conditional statements in PHP, such as if/else and switch case, are used to make decisions based on certain conditions. If a condition is true, the corresponding block of code is executed.

In if/else statements, if the condition inside the parentheses evaluates to true, the code inside the curly braces after "if" is executed; otherwise, the code inside the curly braces after "else" is executed.

Switch case statements evaluate a variable/expression against a list of possible values and execute the corresponding block of code when a match is found.