对于这种条件评估,请使用PHP if()
,否则使用if()
else。
PHP代码如下
<!DOCTYPE html> <html> <body> <?php $gameMode="BUY"; if($gameMode=="TRY") echo "GAME IS IN ",$gameMode," MODE","<br>"; else if($gameMode=="BUY") echo "GAME IS IN ",$gameMode," MODE","<br>"; else echo "GAME IS NEITHER TRY NOR BUY MODE","<br>"; ?> </body> </html>
输出结果
GAME IS IN BUY MODE