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
Explain what is meant by pear in php?
What are php expressions?
Declare a new variable in php equal to the number 3;
What is the function of string in c?
What are arguments in php?
Does php require a web server?
How to swap two variables without using 3rd temp variable.
Is php used anymore?
What is the difference between characters and #?
What is whitespace in html?
Which is not a file-related function in php?
Can we override static method?
Can php variables have numbers?
Is nan in php?
Explain what is the static variable in function useful for?