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:-
- If…else statement:- If one condition is true and other is false then this statement is used.
- Elseif statement:- If there are more than one condition true this statement can be used.
- 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:-
0 comments:
Post a Comment