Say you are studying for an exam.
How does this translate into something useful for PHP developers? Well consider this:
Here is an "if--else" statement in PHP.
Let us step through the code, line by line.
On the other hand, if the if statement was false, then the code contained in the else segment would have been executed.
Here is what would happen if we changed to "$number" to anything but "4".
The variable was set to "421", which is not equal to "4" and the if statement was false.
The code segment contained within the else was used in this case.
NoteFor more detail please see Php Manual at http://www.php.net
သင္သည္ စာေမးပြဲ ေျဖရန္ စာက်က္ ေနသည္ ဆိုပါစို႔။ ေအာက္ပါ အတိုင္း အေျဖ ထြက္မည္။
ငါစာေၾက ရင္ စာေမးပြဲ ေအာင္မည္။ မဟုတ္ရင္ စာေမးပြဲ က်မည္။
အထက္ပါ သေဘာ တရားကို PHP programming မွာဘယ္လို အသံုးခ် ထားတယ္ ဆိုတာ ၾကည့္ၾက ရေအာင္။
ေအာက္တြင္ ေဖၚျပ ထားေသာ "if--else" နမူနာ ကို ေလ့လာ ၾကည့္ပါ။
Code ေတြကို တလိုင္းခ်င္း စစ္ၾကည့္ ၾကရေအာင္။
ေအာက္ေဖၚျပပါ ဥပမာ မွာ၊ $number = 421 လို႔ အရင္ သတ္မွတ္ ေပးလိုက္ ပါတယ္။
$number ဟာ 4 နဲ႔ မညီ ေတာ့ရင္ ဘယ္လို ျဖစ္သြား တယ္ဆိုတာ ေလ့လာ ၾကည့္ပါ။
$number ဟာ 4 နဲ႔ မညီ တဲ့အတြက္ condition ဟာ false ျဖစ္ပါတယ္။
အဲဒီ အခါမွာ code ေနာက္တစ္ေၾကာင္း ျဖစ္တဲ့ "The if statement evaluated to false" ဆိုတဲ့ စာေၾကာင္းကို ေျပာင္းၿပီး echo လုပ္သြားတာ ေတြ႔ရ ပါတယ္။