Returns the value of a constant:
<?php//define a constantdefine("GREETING","Hello you! How are you today?");echo constant("GREETING");?>The constant() function returns a constant value.
Note: This function also works for class constants.
constant( constant )
| parameter | describe |
|---|---|
| constant | Required. Specifies the name of the constant to be checked. |
| Return value: | Returns the value of a constant, or NULL if the constant is undefined. |
|---|---|
| PHP version: | 4+ |