Returns whether a constant has been defined.
Defined is used to test whether a constant exists. It returns TRUE if a constant with the specified name has been defined, and FALSE otherwise.
<?php
define("CONSTANT_A", 1234, FALSE);
if (defined("CONSTANT_A")) {
print "CONSTANT_A exists<br>";
}
if (!defined("CONSTANT_B")) {
print "CONSTANT_B does not exist";
}
?> CONSTANT_A exists
CONSTANT_B does not exist The existence of two different constants are tested.