|
|
Constant variable in PHP using define - PHP
|
Views : 380
|
|
Tagged in : PHP
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
The PHP constant is very similar to a PHP variable in that it is used to store a value but, unlike a variable, the value cannot be changed.
As the name indicates, the variable will be constant through out the programs life cycle.
We can use the function define to declare and set a value for the constant.
Example:
define("CONSTANT_NAME", "value");
echo CONSTANT_NAME;
This will give the output as "value"
|
|
By rajesh, On - 2010-01-02 |
|
|
|