Re: checking for null form fields fails

From: Date: Wed, 08 Aug 2001 08:06:51 +0000
Subject: Re: checking for null form fields fails
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-61765@lists.php.net to get a copy of this message
On Tue, Aug 07, 2001 at 09:26:48AM -0700, Mark Maggelet wrote: > > This isn't right, empty() won't give an error if $input isn't set. That's true. Empty() doesn't return an error when $input isn't defined. I didn't RT(F)M on this one. I always use "(!isset($something) && empty($something))" to check whether or not $something is empty/not set. It's realy more of a feeling. Empty() actualy only checks for a value in $something. It's basicaly the same as "(!$something)" except that empty() doesn't return a warning if $something isn't set (...look, this time I did RTM :). So... basicaly, with empty() you don't check if $something is set. You just don't get to know it. So that's why I use isset() with it. I know the result is the same, but hey... I'm the same guy that checks the returnvalue of printf() and stuff (another thread in this list). So... well... Let's just say I have a 'checking-fetish' of some kind :p -- * R&zE: -- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze@datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- H: +31 23 5516190 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- -- http://www.datalink.nl -- ««««««««««««««««««««««««

« previous php.general (#61765) next »