Re: [PHP] Re: combine empty and trim

2007-03-26 Thread Richard Lynch
On Mon, March 26, 2007 10:50 am, Richard Davey wrote: > Tim wrote: > >> Ross schrieb: >>> 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']))) { >> Hi, >> >> try this: >> >> if (isset($_POST['_createcateg

Re: [PHP] Re: combine empty and trim

2007-03-26 Thread Tim
Richard Davey schrieb: Tim wrote: Ross schrieb: 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']))) { Hi, try this: if (isset($_POST['_createcategory'])) { $value = trim($_POST['_createcategory']); i

Re: [PHP] Re: combine empty and trim

2007-03-26 Thread Richard Davey
Tim wrote: Ross schrieb: 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']))) { Hi, try this: if (isset($_POST['_createcategory'])) { $value = trim($_POST['_createcategory']); if (empty($value)) {

[PHP] Re: combine empty and trim

2007-03-26 Thread Colin Guthrie
Stut wrote: > You could also do something like this... > > $_POST['_createcategory'] = > isset($_POST['_createcategory']) ? > trim($_POST['_createcategory']) : ''; > > if (empty($_POST['_createcategory'])) { > > Still not pretty but slightly better in that you can cleanse your data >

[PHP] Re: combine empty and trim

2007-03-26 Thread Tim
Ross schrieb: 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']))) { Hi, try this: if (isset($_POST['_createcategory'])) { $value = trim($_POST['_createcategory']); if (empty($value)) { } } -- PHP