>
> However, according to my example, the variable is defined and has its
> value as 0 or false, and empty() returns true anyway. I confess that
> I've had some problems like this, and we chose not to use empty(), as
> sometimes 0 or false makes sense as a valid value.
>

That is exactly as the documentation explains it.
empty is to check if a variable is not holding a usable value.
0, false, true are all valid values and show the variable is not
empty.

The purpose for empty is to check for undefined variables, empty
arrays or empty strings.
eg. "", [], null or undefined.

Reply via email to