issetDetermine whether a variable is setDescriptionboolissetmixedvarmixedvar...isset is a language construct.
Returns &true; if var exists; &false; otherwise.
If a variable has been unset with unset, it will no
longer be isset. isset will
return &false; if testing a variable that has been set to &null;. Also
note that a &null; byte ("\0") is not equivalent to
the PHP &null; constant.
Warningisset only works with variables as passing anything
else will result in a parse error. For checking if
constants are set use the
defined function.
]]>
This also work for elements in arrays:
1, 'hello' => NULL);
var_dump( isset ($a['test']) ); // TRUE
var_dump( isset ($a['foo']) ); // FALSE
var_dump( isset ($a['hello']) ); // FALSE
// The key 'hello' equals NULL so is considered unset
// If you want to check for NULL key values then try:
var_dump( array_key_exists('hello', $a) ); // TRUE
?>
]]>
See also empty,
unset, defined,
array_key_exists and the error control
@
operator.