Home >>PHP Tutorial >PHP Conditional Statement

PHP Conditional Statement

Conditional statement in PHP

PHP lets programmers evaluate different conditions during of a program and take decisions based on whether these conditions evaluate to true of false.

These conditions, and the actions associated with them, are expressed by means of a programming construct called a conditional statement.

PHP supports different types of conditional statements

  1. The if Statement : In if Statements Output will appear when only Condition must be true.
  2. The if-else Statement : if-else statements allows you to display output in both the condition(if condition is true display some message otherwise display other message).

  3. The if-elseif-else Statement : The if-else-if-else statement lets you chain together multiple if-else statements, thus allowing the programmer to define actions for more than just two possible outcomes.

  4. The switch Statement :The switch statement is similar to a series of if statements on the same expression.

No Sidebar ads