PHP Conditions

If/Else Example

You passed the class.

Switch/Case Example

Today is Monday.

Explanation

Conditions allow PHP to make decisions based on whether something is true or false. An if/else statement checks a condition and runs different code depending on the result. A switch/case statement compares one value with several possible choices and runs the matching case.

Back to Activity 3