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
What is the differences between $a != $B and $a !== $B?
When use javascript vs php?
Explain me how failures in execution are handled with include() and require() functions?
How to count all the lines of code in a directory and sub folder?
What is Type hinting in PHP?
What advance thing in php7?
Does php support multiple inheritance?
What is php array function?
How do you debug php?
What is php constructor?
What is cookie and why do we use it?
discuss the issue of software theft in ghana and how it has affected the economy
Why do we use cookie?
Php error constants and their descriptions
What is the difference between query and question?