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
Which cryptographic extension provide generation and verification of digital signatures?
How send email using php?
Explain what does the function get_magic_quotes_gpc() means?
What's the best method for sanitizing user input with php?
What is a trait in php?
What is the use of array_count_values() in php?
What is the Pipe Symbol represented?
What is the use of php and mysql?
How to create database connection and query in php?
What is warning – “cannot modify header information – headers already sent”?
What is the difference between file_get_contents() and file_put_contents() in php?
How to genrate report in wordpress cms
How to generate a form?
What are the three parts of an http request?
What software is required for php?