In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Jordan Elver) wrote:
> if($var) {
> // variable is here
> }
>
> But I've noticed that a lot of people do:
>
> if(isset($var)) {
> // variable is here
> }
>
> What's the difference and which is the best way?
Turn up error reporti
Jordan,
http://www.php.net/manual/en/function.isset.php
When you do: if ($var)
you are saying if $var is boolean true
which is not what you say you want:
> Hi,
> If I want to test if a variable exists (or has been passed) then I just do:
>
Mohamed~
Jordan Elver wrote:
>
> Hi,
> If I want t
Hi,
If I want to test if a variable exists (or has been passed) then I just do:
if($var) {
// variable is here
}
But I've noticed that a lot of people do:
if(isset($var)) {
// variable is here
}
What's the difference and which is the best way?
TIA,
Jord
--
Jordan Elver
whi
3 matches
Mail list logo