开发者

PHP.ini whats the variable which relaxes the need for $ with variables?

I'm trying to mirror my ISPs server and he has this set to strict, where you need to specify $

And I don't

What is 开发者_如何学JAVAit ?

EDIT

This works on my test server

if (nothingfound != "TRUE") {

but doesn't on the live server

if ($nothingfound != "TRUE") {

Both are running PHP 5.2.17 (no I can't upgrade to 5.3 at the moment)


if (nothingfound != "TRUE") {

actually only works because PHP will look for a constant called nothingfound and if it doesn't find one, it'll treat the token as the literal string 'nothingfound'. Depending on your error_reporting PHP will issue a notice such as

Notice: Use of undefined constant nothingfound - assumed 'nothingfound' in ...

So to stick with your example

if (nothingfound != "TRUE") {

works, but

if (nothingfound == "TRUE") { 

will never work (unless you have a constant nothingfound defined that contains the string "TRUE").

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜