How to Define a Constant in PHP? Is $ symbol necessary?
Answer Posted / abhishek baranwal
define("CONSTANT", "Hello world.");
echo CONSTANT; // Outputs Hello world
define("CONSTANT", "New Value");
echo CONSTANT; // Outputs Hello world
Means once you declair the define a constant value that
will become every time it will not take new value or it
will not redeclair.if you want change in value then declair
the variables for that purpose.
| Is This Answer Correct ? | 13 Yes | 2 No |
Post New Answer View All Answers
How does the identity operator === compare two values?
What is php and features of php?
How to calculate the length of a string?
What is isset and unset in php?
What beforeFilter() is used?
What was the old name of php?
Which library is used in php to do various types of image work?
How to pass variables and data from php to javascript?
Why is used in php?
Is php is dying?
What is mysql_fetch_object?
What is the capacity of mysql database?
Is php easier than javascript?
Which is true about the singleton design pattern?
What are sql injections, how do you prevent them and what are the best practices?