How to Define a Constant in PHP? Is $ symbol necessary?
Answer Posted / nilsoft
define("CONSTANT", "Its constant");
echo CONSTANT; // Outputs Its Constant
There is no need to use $ sign for it.
$ sign is used for declare variables.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
How to get the ip address of the client?
What are php functions?
What is the purpose of break and continue statement?
What is encapsulation in php?
How is session data stored?
What are the environmental variables?
What is the php function that removes the first element of the array and returns it?
What is the use session in php?
What is cookie?
How to get length of an array in PHP?
Is php a programming language?
What are include() and require() functions?
How do I install php?
What are the methods useful for method overloading?
What is php how it works?