: This article mainly introduces the difference between const and define (PHP). If you are interested in the PHP Tutorial, please refer to it. Description: const is used to define the class member variables. at the same time, const itself is a language structure, and define is a function. const is much faster than define during compilation. Therefore, we recommend that you, use const when const can be used
Differences:
1. const is used for the definition of class member variables. it cannot be modified if its meaning is fixed. Define cannot be used for the definition of class member variables, but can be used for global variables.
2. const cannot be defined in condition syntax, but define can, for example, in if... Else...
3. const uses a normal constant name, and define can use an expression as the name
4. const can only accept static scalar values, while define can use any table expression.
5. const defines the sensitivity of constants in upper case and lower case, while define can use the third parameter (true) to specify whether the case is sensitive.
'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
'). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script
The above introduces the difference between const and define (PHP), including some content, and hopes to help those who are interested in PHP tutorials.