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 string function sql?
Is php a middleware?
How do sessions work in php?
What is the differences between $a != $B and $a !== $B?
What is an object in php?
What is alias in php?
How cookies are transported from browsers to servers?
What is session cookies php?
Is variable name casesensitive in php?
What is the purpose of the following files having extensions: frm, myd, and myi? What these files contain?
How to open a file for reading?
What is super keyword in c++?
What is singleton design pattern in php?
What is $_ server request_method == post?
Explain about require and include function?