How to Define a Constant in PHP? Is $ symbol necessary?
Answer Posted / abhishek baranwal
define("CONSTANT", "Hello world.");
echo CONSTANT; // Outputs Hello world
define("CONSTANT", "New Value");
echo CONSTANT; // Outputs Hello world
Means once you declair the define a constant value that
will become every time it will not take new value or it
will not redeclair.if you want change in value then declair
the variables for that purpose.
Is This Answer Correct ? | 13 Yes | 2 No |
Post New Answer View All Answers
What is binary safe function in php?
Tell me what is the definition of a session?
What is the difference between apache and tomcat?
What is the difference between explode() and split() functions?
Is php dying 2018?
What types of MYSQL function available for affecting columns
Is wordpress a php framework?
What is orm in php framework?
How to Retrieve the Session ID of the Current Session?
Is php a dying language?
What are escaping characters? Explain with an example?
Tell me which programming language does php resemble to?
What are the php functions?
Is php an array?
What is mysql_fetch_object?