In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Andrew Perevodchik) wrote:
> JD> isset checks to see if the $a variable has
> JD> been set, ie, if it exists. if($a) checks for
> JD> the truthood of $a, meaning, if it has a
> JD> non-zero, non-null/empty-string value, then
> JD> its true, else, false.
>
> ... and if it's not set at all it returns a
> warning unless you use "@" :(
Or change the error_reporting level, or turn off display_errors (okay,
technically the warning is still happening in the latter case, but IIRC
that's also true of @--both simply suppress the *reporting* of the report
rather than the *occurance* of the error).
This is why it's best to do multiple checks and choose them carefully. Ex:
if(isset($) and !empty($a) and !$a)
or
if(isset($) and $a===FALSE)
etc.
--
CC
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]