constant
Return the value of a constant
constant()
function returns the value of a constant.
Note: This function can also be used for class constants.
Returns the value of the constant:
<?php // Define a constant define ( "GREETING" , "Hello you! How are you today?" ) ; // Use the constant() function to get the value of a constant and output it echo constant ( "GREETING" ) ; ?>
Try it yourself
constant ( constant )
parameter | describe |
---|---|
constant | Required. Specifies the name of the constant to be checked. |