显示游戏是处于BUY还是TRY模式下的PHP条件?
对于这种条件评估,请使用PHPif()
,否则使用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