defined()
Use this function to determine if there has been defined a constant with a particular name. Pass the name of the constant you’re looking for and you’ll get true if it has been defined or false otherwise.
This function does not work on variables or functions. It is only for constants.
Remember to pass the name as a string. You don’t want to try passing the constant itself; you aren’t even sure if it exists. So put the name in quotes the same as you do when defining them.
define("ONE", "apple"); $a = "ONE"; // the following will return true defined($a); defined("ONE"); // the following will return false defined("one"); // case sensitive defined(ONE); // equates to defined("apple");
See the manual entry for defined
