Re: empty and isset
| From: | Mike dot Kent at indystar dot com | Date: | Thu, 06 Feb 2003 17:35:18 +0000 |
| Subject: | Re: empty and isset | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-134650@lists.php.net to get a copy of this message | ||
Thanks for clearing that up. So input of type text does a set, which makes
isset() true, but isset() does not return true if $var is merely empty.
Jason Wong
<php-general@grem To: php-general@lists.php.net
lins.biz> cc:
Subject: Re: [PHP] empty and isset
02/06/2003 11:28
AM
Please respond to
php-general
On Thursday 06 February 2003 22:50, Mike.Kent@indystar.com wrote:
> > <input> of type text are set regardless of whether you have entered
> > anything.
> > Thus isset() returns true.
> Actually, I believe it's not a matter of the input being set, but the
fact
> that isset() returns true on an empty variable.
Try this:
<?php
if (isset($doo)) {
print '$doo is set'; // does not get printed
}
if (empty($doo)) {
print '$doo is empty'; // gets printed
}
?>
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
The solution to a problem changes the nature of the problem.
-- Peer
*/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php