PHP Conditions

If/Else Example

I am 18 or older.

Switch Case Example

Today is Monday.

I use conditions when I want my PHP program to make a decision. An if/else statement checks whether a condition is true or false. A switch statement can check a value against different cases. The program then runs the code that matches the condition or case.