我在这里做得不对,返回值是不正确的,只是返回else部分..腓如果其他statment
我要检查的输入值大于或等于和更少或相等的条件秀下面,这是做它还是我做错了正确的方式...
$tornadoball = 22;
$tornadoVal = "";
$tornadoScore = "";
if ($tornadoball <= 20 && $tornadoball >= 29): {
$tornadoScore = 0.25;
}
elseif ($tornadoball <= 30 && $tornadoball >= 34): {
$tornadoScore = 0.50;
}
elseif ($tornadoball <= 35 && $tornadoball >= 39): {
$tornadoScore = 0.75;
}
elseif ($tornadoball >= 40): {
$tornadoScore = 1.00;
}
else: {
echo " Value";
}
endif;
$tornadoVal == floatval($tornadoScore);
echo $tornadoVal;
“这是正确的方式” - - 它是否按预期工作? – zerkms 2014-10-10 02:44:03
丢失冒号字符(':')。你的条件应该看起来像是if(condition){statement} elseif(condition){statement}' – Phil 2014-10-10 02:44:22
在php.ini中启用error_reporting,然后修正语法。 – mario 2014-10-10 02:44:26