PHP

If/else statement : (PHP tutorials: Part-4)

Written by Saiful Islam

Different types of PHP codes:

  1. If/else:

This is used to provide 2 conditions. One of them is true and another is false. When the condition within the “if” statement becomes true then the program will execute the commanded task. When the condition becomes false then the program will execute the task of the “else” statement.

Structure:

Example:

No.

Input

Output

1.

  The number is less than 11

2.

  The number is greater than 11

About the author

Saiful Islam

Leave a Comment