> What's the best way to test for an empty form value ? I am doing it like
this now:
$test = $_POST['inputTest'];
if(strlen($test) < 1)
// it is empty !
Maybe I can just go:
if($test == '') // that's two single-quotes with nothing in between
// it is empty !
It has been my experience that the function "empty()" has not failed me.
If you have a string, "" or '' or "0" is empty.
If you have a numeric variable, 0 is empty
Arrays with no elements is empty
A class property that has been declared but not used (set) is empty
A boolean variable that is FALSE is empty
NULL values are empty
Any object with no properties set is empty
http://www.php.net/empty
____________________________________
Wil Moore III, MCP | Integrations Specialist | Assistant Webmaster