RE: [PHP] This is happening why?

2005-06-06 Thread Jay Blanchard
[snip] "; } else { echo "'NULL' != 0"; } ?> [/snip] Interesting, to be sure. I even flipped the test if('NULL' == 0) Of course, once I made 0 a string '0' the test evaluated FALSE. So 0 (integer) is TRUE and 'NULL' is TRUE, which means that you asked if(TRUE == TRUE), which is, of course, T

Re: [PHP] This is happening why?

2005-06-06 Thread tg-php
Yeah.. you're comparing a string, 'NULL' with an integer 0. You're not comparing NULL with anything, you're comparing a string that contains the word 'NULL'. You can use === to do an exact comparison without conversion. echo intval('NULL'); intval('NULL') === 0 = = = Original message = = =