PHP If else

PHP if else Conditional Statement use in my website

In if else Conditional Statement used to check the conditional statement or test condition. we can perform a different action for different condition  There are a various way to use if statement
php if else

  • if
  • if-else
  • if-else-if
  • nested if

If Statement:-

we have the following conditional statements: if statement executes some code if one condition is true

Finally Syntax like as:


Finally, Example –

Finally Output:


If-else Statement:

PHP if-else Statement is executed different operations based on the different conditions whether condition True or False

If-else statement syntax-




The if…elseif….else Statement

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

Seems Like Syntax-

Another Example-

Hence Output:-