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.
<?php $x = ? if ($x == "1") print "1"; if ($x == "2") print "2"; if ($x == "3") print "3"; ?>
打印输出的$x必须是什么"123"?
"123"
您只能分配一次$x值。
$x = true
解决方案:始终使用===. 我从未见过==绝对必要的情况。
===
==
将此作为检查规则添加到您的 IDE。