PHP constants, what are the PHP constants
The define () function is used to define constants. Once a constant is defined, it can no longer be changed or undefined.
Examples of defining constants:
Run
The constant name and any other PHP tags follow the same naming conventions. A valid constant name begins with a letter or underscore followed by any letter, number, or underscore.
Changshime is considered case-sensitive, and by convention constant identifiers are always uppercase, and the value cannot be changed during script execution.
To define the difference between a constant and a defined variable:
- No dollar sign ($) before constant
- Constants can only be defined with the Define () function, not through assignment statements
- Constants can be defined and accessed anywhere without regard to the rules of variable scope
- Constants cannot be redefined or undefined once defined
- The value of a constant can only be scalar
PHP contains a number of pre-defined constants, which can be viewed in PHP manuals.
Original address: http://www.manongjc.com/php/php_constant.html
Related reading:
PHP Str_pad () function to complement string to specified length
PHP str_replace () string substitution function usage analysis and explanation
The PHP str_ireplace () function does not match the characters in a case-insensitive replacement string
The PHP str_getcsv () function parses a CSV string into an array
http://www.bkjia.com/PHPjc/1128372.html www.bkjia.com true http://www.bkjia.com/PHPjc/1128372.html techarticle PHP constants, PHP constants, which define () functions are used to define constants. Once a constant is defined, it can no longer be changed or undefined. Example of defining constants:? Phpdefine ("Consta ...