Php 比较数字和字符串
我需要你的帮助,找出如何将多个if语句与不同的条件组合起来。下面是我正在努力工作的代码Php 比较数字和字符串,php,if-statement,multiple-conditions,Php,If Statement,Multiple Conditions,我需要你的帮助,找出如何将多个if语句与不同的条件组合起来。下面是我正在努力工作的代码 <p><?php $age="25"; $ID="prog5"; if($age >= "16" && $age <= 32 && $ID == prog5) { print "Welcome to the Future of Systems"; } else {
<p><?php
$age="25";
$ID="prog5";
if($age >= "16" && $age <= 32 && $ID == prog5) {
print "Welcome to the Future of Systems";
}
else {
print "Sorry, your ID isn't recognized by sync. Please click here for further assistance.";
}
?></p>
像这样更改if语句
简而言之,字符串文字由引号分隔:
if($age>=16 && $age<=32 && $ID=="prog5")
如果($age>=16&&$age谢谢,这很有效!:)