PHP鎺у埗缁撴瀯涔媏lse
鍐呭鎽樿
缁忓父闇瑕佸湪婊¤冻鏌愪釜鏉′欢鏃舵墽琛屼竴鏉¤鍙ワ紝鑰屽湪涓嶆弧瓒宠鏉′欢鏃舵墽琛屽叾瀹冭鍙ワ紝杩欐鏄 else 鐨勫姛鑳姐
鏂囩珷姝f枃
else
缁忓父闇瑕佸湪婊¤冻鏌愪釜鏉′欢鏃舵墽琛屼竴鏉¤鍙ワ紝鑰屽湪涓嶆弧瓒宠鏉′欢鏃舵墽琛屽叾瀹冭鍙ワ紝杩欐鏄 else 鐨勫姛鑳姐俥lse 寤朵几浜 if 璇彞锛屽彲浠ュ湪 if 璇彞涓殑琛ㄨ揪寮忕殑鍊间负 FALSE 鏃舵墽琛岃鍙ャ備緥濡備互涓嬩唬鐮佸湪 $a 澶т簬 $b 鏃舵樉绀 a is bigger than b锛屽弽涔嬪垯鏄剧ず a is NOT bigger than b锛 <?php
if ($a > $b) {
echo "a is bigger than b";
} else {
echo "a is NOT bigger than b";
}
?> else 璇彞浠呭湪 if 浠ュ強 elseif锛堝鏋滄湁鐨勮瘽锛夎鍙ヤ腑鐨勮〃杈惧紡鐨勫间负 FALSE 鏃舵墽琛岋紙鍙傝 elseif锛夈
缁忓父闇瑕佸湪婊¤冻鏌愪釜鏉′欢鏃舵墽琛屼竴鏉¤鍙ワ紝鑰屽湪涓嶆弧瓒宠鏉′欢鏃舵墽琛屽叾瀹冭鍙ワ紝杩欐鏄 else 鐨勫姛鑳姐俥lse 寤朵几浜 if 璇彞锛屽彲浠ュ湪 if 璇彞涓殑琛ㄨ揪寮忕殑鍊间负 FALSE 鏃舵墽琛岃鍙ャ備緥濡備互涓嬩唬鐮佸湪 $a 澶т簬 $b 鏃舵樉绀 a is bigger than b锛屽弽涔嬪垯鏄剧ず a is NOT bigger than b锛 <?php
if ($a > $b) {
echo "a is bigger than b";
} else {
echo "a is NOT bigger than b";
}
?> else 璇彞浠呭湪 if 浠ュ強 elseif锛堝鏋滄湁鐨勮瘽锛夎鍙ヤ腑鐨勮〃杈惧紡鐨勫间负 FALSE 鏃舵墽琛岋紙鍙傝 elseif锛夈
浠ヤ笂灏辨槸PHP鎺у埗缁撴瀯涔媏lse鐨勮缁嗗唴瀹癸紝鏇村淇℃伅璇峰叧娉∣D浜戝叾瀹冪浉鍏虫枃绔狅紒