Returns whether a variable has been set.
The isset() function returns TRUE if a variable has been set with a value. Multiple variables can be tested at the same time. TRUE is returned only if all the variables tested have been set.
<?php
$a = "Some data";
if (isset($a)) {
print "\$a = $a<br>";
}
if (!isset($b)) {
print "\$b does not exist<br>";
}
if (isset($_REQUEST["c"])) {
print "c sent via URL.";
} else {
print "c not available.";
}
print "<br><br><a href=\"isset.php?c=hello\">Link that passes c</a>";
?> $a = Some data
$b does not exist
c sent via URL.
Link that passes c $a has been set with a value and is printed. $b has not been set. c is sent when the user clicks the link.