For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > May 2007 > Re: [PHP-DB] weird comparsion









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DB] weird comparsion
Aleksandar Vojnovic

2007-05-03, 7:57 am

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
> NULL is changed to 0).
>
> if ("foo"==0) echo("foo equals to 0");
>
> OKi98
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com