2 afwas May 26, 2008 00:33

Weirdly enough, so is blonde
<?php
echo 'bugger me '.( empty( $blonde ) ? 'I should have known better' : 'it doesn\'t work, no surprises there then :' );
?>
¥
NULL == 0 == false == ''
but:
NULL !== 0 !== false !== ''
Use "===" / "!==" if you also want to check the type of the var.
Thanks blueyed (and Afwas and ¥åßßå)! I rarely think about === or !== because I'm pretty simple, but yeah lots of the details pages at php.net say to use it for this or that or the other thing.
Cool. So I can leave the table defaulting to NULL and still check it with either == NULL or == '' and expect basically the same results. The first is obviously better so that is what a smart person would do.
NULL is an entity in php also, so you can test on NULL