Tag: LAN value represents an int CAs strong case PHP constant
Q: Why do I need constants?
A: Because in PHP development we want to have values that are not changed, so there is a constant. (Current cognition)
PHP 5 Constants
When a constant value is defined, it cannot be changed anywhere else in the script.
PHP Constants
A constant is an identifier for a simple value. The value cannot be changed in the script.
A constant consists of an English letter, an underscore, and a number, but the number cannot appear as a first letter. (The constant name does not require a $ modifier).
Note: constants can be used throughout the script.
Set PHP Constants
To set constants, use the Define () function with the following function syntax:
Define (string constant_name, mixed value, case_sensitive = True)
The function has three parameters:
- Constant_name: Required parameter, constant name, or marker.
- Value: A required parameter, a constant.
- Case_sensitive: Optional parameter that specifies whether case sensitive, set to True indicates insensitivity.
tip: When using PHP, be aware of the difference between constants and variables.
PHP Learning Notes-Constants