Re: [PHP] combine empty and trim

2007-03-26 Thread Richard Lynch
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

Re: [PHP] combine empty and trim

2007-03-26 Thread Robert Cummings
On Mon, 2007-03-26 at 16:23 +0100, Stut wrote: > 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']))) { > > You can't do this because empty needs the variable - it can't work on

Re: [PHP] combine empty and trim

2007-03-26 Thread Brad Bonkoski
Brad Bonkoski wrote: 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']))) { perhaps try: if( strlen(trim($_POST['...']))) <= 0 ) { ... } don't think empty is the right function for this... -Br

Re: [PHP] combine empty and trim

2007-03-26 Thread Stut
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']))) { You can't do this because empty needs the variable - it can't work on teh return value. The closest you can get would be... if (isset($_PO

Re: [PHP] combine empty and trim

2007-03-26 Thread Brad Bonkoski
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']))) { perhaps try: if( strlen(trim($_POST['...']))) <= 0 ) { ... } don't think empty is the right function for this... -Brad -- PHP General M

[PHP] combine empty and trim

2007-03-26 Thread Ross
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']))) { -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php