Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP constant() Function

PHP constant() Function

PHP Misc Reference Manual PHP Misc Reference Manual

Example

Return the value of a constant:

Run Example »


Definition and Usage

The constant() function returns the value of a constant.

Note: This function also works with class constants.


Syntax

constant(

constant

)

Parameters Description
constant Required. Specifies the name of the constant to check.

Technical Details

Return Value: Returns the value of the constant, or NULL if the constant is not defined.
PHP Version: 4+

PHP Misc Reference Manual PHP Misc Reference Manual