PHP Constant

 

In PHP, a constant is an identifier (name) for a simple value that cannot be changed or redefined during the execution of a script. Unlike variables, constants do not use a dollar sign ($) and are automatically global across your entire application.

 

Constant vs. Variable
 
FeatureConstantVariable
SyntaxNo $ sign (e.g., NAME)Starts with $ (e.g., $name)
ValueFixedChangeable
ScopeAlways GlobalLocal by default 
AssignmentVia define() or constVia = operator

 

To create a Constant, the syntax is:

Define(name, value, case-insensitive)