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 difference between required and require_once in php?
Explain how we can retrieve the data in the result set of mysql using php?
Do you know what are traits?
Explain me what are the 3 scope levels available in php and how would you define them?
What is mvc in php?
How should a model be structured in mvc?
What software is required for php?
Explain the difference b/w static and dynamic websites?
What are different types of Print Functions available in PHP?
What is difference between get and post in php?
What are php errors?
How can we check the value of a given variable is alphanumeric?
What is form submission?
How variables are passed through arguments?
What are php expressions?