IF operation in PHP
if operation in PHP defines which route the application needs to take based om the evaluation of a Boolean expression.
The code inside of the if statement will be executed only in case when the condition of the expression is true, if it is false the statement inside of the if statement will be skipped.
It is possible to specify more if conditions if the first if condition fails. These are specified by elseif keyword and Boolean expression inside of it.
There may be more than one elseif section.
The code of that section will be executed where the first occurrence of the expression is equal to true, the rest of the conditions may also return true, however they will be skipped over.
It is possible to specify else condition in the if statement. else condition is optional. Code that is inside of else statement will be executed only in case, when the prior cases return false.
Comments
Post a Comment