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
How is it possible to parse a configuration file?
What are the advantages of stored procedures?
Difference between mysql_connect and mysql_pconnect?
What is php and why we use it?
Can we learn php without html?
Which is used to maintain the value of a variable over different pages?
Tell me how do I check if a given variable is empty?
Is python easier than php?
What is the use of header() function in php?
Can we override static method?
How to pad an array with the same value multiple times?
What is strlen function in php?
What are some of the advanced features of php?
How to get complete current page url in php?
Can we set session value in javascript?