The value of the empty() function?
Posted: Mon Aug 04, 2003 4:16 pm
I'm just getting started with PHP, but I couldn't find a discussion on this subject. A number of posters on the PHP manual decry the empty() function, but they be viewing it solely from what they want to do.
But my question is this....
I'm using empty() to determine whether or not a string variable is returned from a database. Am I correct in thinking that
is the same as
and that, similarly,
and
are the same?
But my question is this....
I'm using empty() to determine whether or not a string variable is returned from a database. Am I correct in thinking that
Code: Select all
if (empty($var)) {...Code: Select all
if (!$var) {...Code: Select all
if (!empty($var)) {...Code: Select all
if (!$var) {...