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 can we determine whether a php variable is an instantiated object of a certain class?
What is $row in php?
If the variable $var1 is set to 10 and the $var2 is set to the character var1, what's the value of $$var2?
What are the differences between session and cookie?
What is the difference between rest and soap?
What is the expansion of LAMP?
When should you use a stored procedure?
How the result set of mysql be handled in php?
What is whitespace in html?
Is array empty php?
Tell me what is the difference between get and post?
What does $this do in php?
Is php free to use?
I need to know about the courses which are useful in corporate companies.. especially php/mySQL, Java/j2ee, .NET.. also tell if any other courses are valuable
What is meant by pear in php? What is the purpose of it?