Just like an "if statement", an "elseif statement" also contains a conditional statement, but it must be preceded by an "if statement".
You cannot have an "elseif statement" without first having an "if statement".Now, if we wanted to also check to see if the big boss Sam was the employee we need to insert an elseif clause.
PHP first checked to see if $employee was equal to "Ms. Smith", which evaluated to false.
Next, PHP checked the first "elseif statement. $employee did in fact equal "Sam" so the phrase "Good Morning Sir!" was printed out.
If we wanted to check for more employee names we could insert more "elseif statements.
Remember that an "elseif statement" cannot be used unless it is preceded by an "if statement!
Note
For more detail please see
Php Manual at http://www.php.net