Re: isset()

From: Date: Sun, 25 Feb 2001 18:50:15 +0000
Subject: Re: isset()
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-41598@lists.php.net to get a copy of this message
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))

« previous php.general (#41598) next »