Check whether a constant exists:
<?phpdefine("GREETING","Hello you! How are you today?");echo defined("GREETING");?>The defined() function checks whether a constant exists.
defined( name )
| parameter | describe |
|---|---|
| name | Required. Specifies the name of the constant to be checked. |
| Return value: | Returns TRUE if the constant exists, FALSE otherwise. |
|---|---|
| PHP version: | 4+ |