我正在尝试镜像我的ISP服务器,他将此设置为严格,您需要指定$
我不
这是什么?
修改
这适用于我的测试服务器
if (nothingfound != "TRUE") {
但不在实时服务器上
if ($nothingfound != "TRUE") {
两者都在运行PHP 5.2.17(目前我无法升级到5.3)
答案 0 :(得分:4)
if (nothingfound != "TRUE") {
实际上只能起作用,因为PHP会查找一个名为nothingfound
的常量,如果找不到,它会将该标记视为文字字符串'nothingfound'
。根据您的error_reporting
,PHP会发出通知,例如
Notice: Use of undefined constant nothingfound - assumed 'nothingfound' in ...
所以坚持你的例子
if (nothingfound != "TRUE") {
有效,但
if (nothingfound == "TRUE") {
将永远不会起作用(除非您定义的常量nothingfound
包含字符串"TRUE"
)。