Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何检查以下值:
$var1 = x <= 100; $var2 = 'P1, P2'; $check = array ($var1, $var2);
如果有数据输入如下:
$input1 = 60; $input2 = P2;
如果其中包含的值$input1将值 1,如果 包含在其中$var1的值将值 1,如果不是,则为 0。我怎么看?谢谢你$input2$var2
$input1
$var1
$input2
$var2
这就是我猜你想要的,但是我认为存在一定的语言障碍。
$var1 = 100; $var2 = 'P1, P2' $input1 = 60; $input2 = 'P2'; $check = 60 <= $var1 ? 1 : 0; $check = strpos($var2, $input2) ? 1 : 0;