Re: [PHP] Testing if variable was set

2001-05-17 Thread CC Zona
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

Re: [PHP] Testing if variable was set

2001-05-17 Thread Mohamed LRHAZI
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

[PHP] Testing if variable was set

2001-05-17 Thread Jordan Elver
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