|
Answer» Few difference between variables and constants in PHP are given below: | Variables | Constants |
|---|
| The value of a variable can be CHANGED during the execution. | The constant value can’t be changed during script execution. | | Variables require COMPULSORY usage of the $ sign at the start. | No dollar sign ($) is REQUIRED before using a constant. | | It is possible to define a variable by simple assignment. | Constants can’t be defined by simple assignments. They are defined using the define() function. | | The default scope is the current ACCESS scope. | Constants can be accessed throughout without any scoping rules. |
|