Re: isset()

From: Date: Sun, 25 Feb 2001 19:28:51 +0000
Subject: Re: isset()
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-41600@lists.php.net to get a copy of this message
empty() fails when $var == 0 --Joe On Sun, Feb 25, 2001 at 10:50:15AM -0800, Chris Adams wrote: > On 25 Feb 2001 00:01:30 -0800, Mark Maggelet <maggelet@mminternet.com> wrote: > >On Sat, 24 Feb 2001 17:51:07 +0100, Christian Reiniger > >(creinig@mayn.de) wrote: > >>On Saturday 24 February 2001 17:18, PHPBeginner.com wrote: > >>> in my preceding email I've written: > >>> > >>> if($var!='') > >>> > >>> will fix your all your worries without an intervention of a > >strings > >>> function. > >> > >>Except that it will throw a warning in PHP4 if $var is not set. > >>=> isset () should be used. > > > >man, this is like the thread that will not die. isset() will return > >true for an empty string, which is not what he wants. the right thing > >to do is use > > > >if((isset($var))&&($var!="")) > > Isn't this a bit more legible: > > if (!empty($var)) > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net -- ------------------------------------------------------------------------------- Joe Stump, PHP Hacker, joestump98@yahoo.com -o) http://www.miester.org http://www.care2.com /\\ "It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V -------------------------------------------------------------------------------

« previous php.general (#41600) next »