A constant is a name or an identifier for a simple value that cannot be change. By default a constant is case-sensitive. By convention, constant identifiers are always uppercase.
A constant name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. If you have defined a constant, it can never be changed or undefined.
There is a predefine function named define() in PHP. With this function you do not need to have a constant with $ unlike with variable. You can aslo use constant() function to read a constant's value.
It is used to define a constant.
define(name, value, case-insensitive)
This function will return the value of the constant.
This is useful when you want to retrieve value of a constant, but you do not know its name, i.e. It is stored in a variable or returned by a function.
In this example both the echo statements returns the same value.
Constants are automatically global and can be used across the entire script. If once you define the constant you can use it anywhere in the script.