Hello,
Why does anything compared to 0 return true?
I know it might seem to be a bit off-topic, but for me it is important
for detecting if NULL value in table has been changed (for example NULL
is changed to 0).
if (foo==0) echo(foo equals to 0);
OKi98
--
PHP Database Mailing List
http://nl3.php.net/manual/en/language.operators.comparison.php
try using === (3x =) for comparison
- Mike
OKi98 schreef:
Hello,
Why does anything compared to 0 return true?
I know it might seem to be a bit off-topic, but for me it is important
for detecting if NULL value in table has been
try comparing the type:
if(0 === 0)echo 'Its not equal';
if(0 === 0)echo 'Its equal';
OKi98 wrote:
Hello,
Why does anything compared to 0 return true?
I know it might seem to be a bit off-topic, but for me it is important
for detecting if NULL value in table has been changed (for example
Mike van Hoof wrote:
http://nl3.php.net/manual/en/language.operators.comparison.php
try using === (3x =) for comparison
- Mike
OKi98 schreef:
Hello,
Why does anything compared to 0 return true?
I know it might seem to be a bit off-topic, but for me it is
important for detecting if NULL
On 03 May 2007 12:30, OKi98 wrote:
I know about identity operator (===) but with == operator 0 is false
and foo is true
No, that's not correct.
, try this:
$foo=0;
$bar=bar;
if ($foo) echo($foo is true, );
else echo($foo is false, );
if ($bar) echo($bar is true, );
else
Ford, Mike wrote:
On 03 May 2007 12:30, OKi98 wrote:
I know about identity operator (===) but with == operator 0 is false
and foo is true
No, that's not correct.
, try this:
$foo=0;
$bar=bar;
if ($foo) echo($foo is true, );
else echo($foo is false, );
if ($bar) echo($bar is