: This article mainly introduces the constants of PHP beginners. For more information about PHP tutorials, see. Constant; frequently used things, some important values do not want to be changed, the antonym of the variable can be understood as a dead, unchanged value, similar to the name of a person,
Naming rules;
1. similar to constants. For more information, see the previous blog.
2. to distinguish it from variables, all uppercase letters are usually used.
Features;
1. After definition, the value cannot be changed
2. after the name is set, this name cannot do anything else. it can only represent this value.
3. After definition, you can call
Value assignment type; Integer, float type, string, Boolean, NULL
Definition;
1. method; define ("constant name", "constant value", "whether it is case sensitive") the third parameter is not writable. the default value is false.
2. Reference: directly reference the defined constant name on the current page.
For constant reference defined on other pages, use include ("name of the page where the constant is located") to load that page and then reference
The above describes the constants of PHP beginners, including some content, and hope to help those who are interested in PHP tutorials.