Php Statement

If Statement

PHP if statement is executed if condition is true.

Syntax :-

Example :-

Result

Have a goog day!

If-else Statement

PHP if-else statement is executed whether condition is true or false.

Syntax :-

Example :-

Result

Have a good day!

if...elseif....else Statement

The if....elseif...else statement executes different codes for more than two conditions.

Syntax :-

Example

Result

The hour is 15, and will give the following message:
Have a good day!