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
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
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))
{
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
>
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
5 matches
Mail list logo