September 2001
Intermediate to advanced
768 pages
32h 45m
English
bool isset(mixed variable) Tests whether a variable is set.
Returns:
TRUE if the variable contains a value other than NULL; FALSE otherwise
Description:
isset() is used to check whether a variable is currently set.
Note:
If the variable contains a null value (NULL), isset() returns FALSE. Note that a null byte ("\0") is not equivalent to the PHP constant NULL. If a variable contains only a null byte ("\0"), it is still considered to be set.
Also note that isset() cannot be used on a literal (such as 10, "A string", and so on)—see the example.
Availability:
UNIX, Windows
Version:
3+, 4+
See also:
empty()
Example:
<pre> <?php $greeting = "Hi!"; if (isset ($value)) print "\$greeting is set.\n"; else print ... |
Read now
Unlock full access