I had given a try on your code, But it really output "1", a true value.
I used "PHP 4.2.2+Apache 1.3.26" under Win2K. And u?
- Original Message -
From: lallous
Sent: 2002Äê8ÔÂ3ÈÕ 16:19
To: [EMAIL PROTECTED]
Subject: Re: [PHP] isset($var) && !empty($v
lallous
Sent: 2002Äê8ÔÂ3ÈÕ 15:01
To: [EMAIL PROTECTED]
Subject: Re: [PHP] isset($var) && !empty($var) same time!
Just use empty() ?!
With error_reporting(E_ALL) you'll get a bunch of warnings if you only use
empty() w/o the isset() !
use isset() first and then check wheter empty o
first.
- Original Message -
From: lallous
Sent: 2002Äê8ÔÂ3ÈÕ 15:01
To: [EMAIL PROTECTED]
Subject: Re: [PHP] isset($var) && !empty($var) same time!
Just use empty() ?!
With error_reporting(E_ALL) you'll get a bunch of warnings if you only use
empty() w/o the isset() !
use isse
Just use empty() ?!
With error_reporting(E_ALL) you'll get a bunch of warnings if you only use
empty() w/o the isset() !
use isset() first and then check wheter empty or not empty!
so there is not one function that tests for empty and isset same time!?
Elias
"Analysis & Solutions" <[EMAIL PROT
Folks:
On Fri, Aug 02, 2002 at 07:01:38PM +0200, Jürgen wrote:
>
> Why would i ever want to use isset() then?
Because sometimes you just want to check if something is set due to null,
'' and 0 being important.
$var = '';
empty($var); // evaluates to true
isset($var); // evaluates t
But if this is true what you say, that empty() checks for
not set
null
an empty string
zero
Why would i ever want to use isset() then?
If i understood you correctly, would the following
op = isset($_GET['op']) && !empty($_GET['op']) ? $_GET['op'] : '';
be the same as
op = !empty($_GE
On Fri, Aug 02, 2002 at 04:48:17PM +0200, lallous wrote:
>
> function issne($var)
> {
>return isset($var) && !empty($var) ? true : false;
> }
>
> is there is any builtin function that does that? (one function call).
Yes. Just use empty(). It automatically checks if the variable is:
not
I have wrote this function:
function issne($var)
{
return isset($var) && !empty($var) ? true : false;
}
which can be called as: if (issne(&$mightbeundefinedvariable)) echo "using
this variable";
is there is any builtin function that does that? (one function call).
//Elias
--
PHP Gene
8 matches
Mail list logo