这就是我有问题的地方......当有人选择$ r并且当有人选择$ p时会显示“你有我的尊重”但是它保持打印“你有我的尊重”时,我希望这显示给我“你是个笑话” “无论哪种方式!
<?php
$r = ("silver"."bronze"."cooper");
$p = ("gold"."platinium"."diamond");
if($r == 'silver'.' bronze'.'cooper'){
echo "You Are a Joke";
} elseif ($p == "gold"."platinium"."diamond"){
echo "You Have My Respect";
} else {
echo "Your Rank Is *** Bro";
}
?>
答案 0 :(得分:0)
从extra space
移除' bronze'
,以便解决您的问题
<?php
$r = ("silver"."bronze"."cooper");
$p = ("gold"."platinium"."diamond");
if($r == 'silver'.'bronze'.'cooper'){ //remove extra space
echo "You Are a Joke";
} elseif ($p == "gold"."platinium"."diamond"){
echo "You Have My Respect";
} else {
echo "Your Rank Is *** Bro";
}
?>