Re: combine empty and trim

From: Date: Mon, 26 Mar 2007 19:22:38 +0000
Subject: Re: combine empty and trim
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-251395@lists.php.net to get a copy of this message
On Mon, March 26, 2007 10:17 am, Ross wrote: > I want to trim any whitepace and check if it is empty in the same > line this > is not working. > > if (empty(trim($_POST['_createcategory']))) { Define "not working" if you would... Personally, I always use isset() to determine if any POST data was sent, and then deal with what was sent, perhaps doing trim, and always scrubbing and validating the data. empty() changed its behaviour on "0" from version to version. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#251395) next »