Constants
This returns the value of the constant.
Constant in PHP can be declared by using keyword “define”
Eg.
define(“MAXLENGTH”, “100”);
CODE
define(“MAXLENGTH”, “100”);
echo MAXLENGTH;
?>
OUTPUT
We can define the constants in the config file of the project so that we can use this anywhere in the site.
Leave a comment