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!
NoteFor more detail please see Php Manual at http://www.php.net
If statement နဲ႔ elseif statement ဟာ သေဘာတရား နဲ႔ လုပ္ေဆာင္ ပံုခ်င္း အတူတူ ပါဘဲ။ true နဲ႔ false ကို စစ္ေဆး တာပါဘဲ၊ ဒါေပမဲ့ elseif statement ရဲ ေရွ့မွာ if statement ရွိရ ပါမယ္။
If statement ကိုေရွ႔က အရင္ မေရးပဲ elseif statement ကိုသံုးလို႔ မရ ပါဘူး။
အေပၚမွာ ျပထားတဲ့ ရိုးရိုး If-Else ဥပမာ ကို ေအာက္မွာ ျပထား တဲ့အတိုင္း ၾကားထဲမွာ elseif တလိုင္း ထပ္ထဲ့ ထားတဲ့ ပံုစံ ကို သေဘာေပါက္ ေအာင္ ေလ့လာပါ။ elseif ဟာ တလိုင္း မကဘဲ လိုင္းေတြ အမ်ားႀကီး ရွိႏိုင္ ပါတယ္။
PHP ဟာ ပထမ ဆံုး $employee ဟာ Ms. Smith ဟုတ္မဟုတ္ စစ္ေဆး ပါတယ္။ false ျဖစ္ေန ပါတယ္။
ထို႔ေနာက္ PHP ဟာ ေနာက္က ကပ္ ပါလာတဲ့ elseif statement. နဲ႔ $employee ဟာ Sam ဟုတ္မဟုတ္ စစ္ေဆး ျပန္ပါတယ္။ True ျဖစ္တဲ့ အတြက္ "Good Morning Sir!" ကို echo လုပ္ ပါတယ္။
ေနာက္ထပ္ employee စစ္ေဆး ခ်င္ေသးရင္ elseif statements ေတြ ထပ္ထဲ့ ႏိုင္ပါတယ္။
တစ္ခုေတာ့ မွတ္ထားပါ ပထမဆံုး elseif statement ရဲ့ေရွ့မွာ if statement တခု ရွိရ ပါမယ္။