The Isset function is to detect whether a variable is set.
Format: bool Isset (mixed var [, mixed Var [, ...])
return value:
Returns FALSE if the variable does not exist
Returns FALSE if the variable exists and its value is null
Returns TURE if the variable exists and the value is not NULL
Returns TRUE if each item meets the previous requirement when checking multiple variables at the same time, otherwise the result is FALSE
If a variable has been freed with unset (), it will no longer be isset (). If you use Isset () to test a variable that is set to NULL, FALSE is returned. Also note that a null byte ("s") is not equivalent to a null constant in PHP.
Warning: isset () can only be used for variables, because passing any other parameter will result in parsing errors. To detect if a constant is set, use the defined () function.
<?php$var = "; if (isset($var)) {print "This var was set set so I'll print."} //
<?PHP$a=Array(' Test ' = 1, ' hello ' = =NULL);Var_dump(isset($a[' Test '));//TRUEVar_dump(isset($a[' foo ')];//FALSEVar_dump(isset($a[' Hello '));//false//' hello ' equals NULL, so it is considered unassigned. If you want to detect NULL key values, you can try the methods below. Var_dump(array_key_exists(' Hello ',$a) );//TRUE?>
PHP Isset Function action