Re: PHP and empty() if form value is 0

From: Date: Sun, 05 Jan 2003 06:04:29 +0000
Subject: Re: PHP and empty() if form value is 0
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-130300@lists.php.net to get a copy of this message
On Sat, 4 Jan 2003 20:33:14 -0500, you wrote: >I couldn't think of isset, so I winged it: > >if (strlen($var) > 0) {...} This should work most of the time, but be aware this will produce a warning if $var isn't set (and you haven't set your error reporting level to ignore warnings)... If you're not sure that $var exists it's better to check it with isset() before checking strlen()...

« previous php.general (#130300) next »