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
Which are the best start and end tags to use?
How many records can be stored in mysql table?
Why does php need server?
"mysql_fetch_row — Get a result row as an enumerated array",this sentence comes from the PHP offical manual.However ,i can not understand the words "enumerated array".I need some help.Thanks a lot to everyone that reply.
What are string functions?
What is the use of strpos in php?
Can php run without apache?
What is url encoding and decoding in php?
What is the use of super-global arrays in php?
Explain the syntax for ‘foreach’ loop with example.
List some sorting functions in php?
Do you know how can php and html interact?
What is c++ polymorphism?
Tell me what is mean by an associative array?
how to track no of users logged in?