1.

Explain the process Conditional Statements in PHP? PHP Conditional statements:

Answer»

Conditional statements are useful for writing decision making logics. It is most important feature of many programming languages, including PHP.

They are implemented by the following types:

(i) if Statement:

If statement executes a statement or a group of statements if a specific condition is satisfied as per the user expectation.

(ii) if…else Statement:

If statement executes a statement or a group of statements if a specific condition is satisfied by the user expectation. When the condition gets false (fail) the else block is executed.

(iii) if…elseif….else Statement:

If-elseif-else statement is a combination of if-else statement. More than one statement can execute the condition based on user needs.

(iv) Switch Case:

The switch statement is used to perform different actions based on different conditions based on different conditions.



Discussion

No Comment Found