All About Decision Making Statements in PHP


If, elseif and switch statement are used for making decision based on different situations. 

Conditional statement can be used to make decisions. There are 3 decision making statements in PHP:-
  1. If…else statement:- If one condition is true and other is false then this statement is used.
  1. Elseif statement:- If there are more than one condition true this statement can be used.
  1. Switch statement:- This statement is used to select one block of code to execute out of many blocks. This is beneficial to avoid long blocks of if…else, elseif codes.

To read more about each click below links:-
  1. If…else statement
  1. Elseif statement
  1. Switch statement


 


0 comments:

Post a Comment

Recent Post

All Loop Types in PHP

Loops are used to execute a block of codes until a certain condition is met. The main benefit of using a loop is to save the time and effor...

Popular Posts