我觉得发布这个非常非常愚蠢,但我找不到答案.我搜索谷歌和这里.
// originally values in a multi dimensional array, but used simple values
// to rule out errors.
$somenumber = 1; $anotherone=5;
if ($somenumber < $res->shares < $anotherone ) {
//blah
}
Run Code Online (Sandbox Code Playgroud)
得到错误:
Parse error: syntax error, unexpected '<'
看起来非常简单直接.是否有一些奇怪的事情你无法比较多个值?我必须明确输入吗?
它适用于Perl.这当然意味着它必须在其他所有方面都这样工作.;)
不幸的是,你不能像这样链接比较运算符,你需要用an和(&&)加入它们.请参阅以下示例:
$somenumber = 1; $anotherone=5;
if ($somenumber < $res->shares && $res->shares < $anotherone ) {
//blah
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
635 次 |
| 最近记录: |