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 csrf mvc?
Write a program to find the factorial of a number in php?
Is ruby on rails php?
What are traits?
List data types in PHP?
Explain how we can retrieve the data in the result set of mysql using php?
Explain mysql_error().
Explain Type hinting in PHP?
Is empty java?
What type of headers have to be added in the mail function to attach a file?
Why print_r is used in php?
What are the ways to include file in php?
Why do you need php?
Do you know how to enable error reporting in php?
How to increase the execution time of a PHP script?