Possible Duplicate:
php: ‘0’ as a string with empty()
I have an input in a form like so
<input name='var' type='number'>
When the form is submitted, input is sent to a PHP file through POST. On the PHP file, it checks to see if the input is filled out by checking
empty($_POST['var'])
When I enter '0' (zero) into the textbox and submit the form, the PHP code returns '1' for empty($_POST['var']) even though I have tried print_r($_POST) and 'var' clearly has the value of '0'.
Is this supposed to happen? Do I just need to also check for == 0 for this exception? Thanks.