PHP If-else Statement With Example

if...else statement

Use the if... statement to execute some code if a condition is true and another code if the condition is false.

It executes some code if a condition is true and another code if the condition is false.


Syntax:



Folowhart

Example:



Result:



  Have a good day!


Read Also: