On Tuesday 22 May 2001 08:30, Rasmus Lerdorf wrote:

> if(!empty($var1)) is true if $var1 is set to anything except a null-string

I think this should be

if(!empty($var1)) is true if $var1 is set to anything except a null string, 0 
or the string '0'

It would be great, unless I've missed the point somewhere along the line, if 
empty treated '0' (string) as not empty, then the function could be used for 
checking user input where the string '0' is perfectly valid. In thousands of 
lines of PHP code I haven't been able to use empty() once - I always end up 
going
 if(isset($var) && strcmp($var,''))...

Just a dream :)
-- 
Phil Driscoll

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to