illustrate
1. Const defines PI as a variable. Defined constants can only be placed in the top directory and cannot be placed in if statements or {} in functions.
2. define is a macro definition, and defined constants can be placed anywhere.
Note that the macro definition is not a statement in the strict sense of C or C++, so it does not need to end with a semicolon at the end of the line.
Example
Symbolic constant #define Pi 3.1415926f; Constant value variable const float pi 3.1415926f;
The above is a comparison of the two definition methods in PHP constants. I hope it will be helpful to everyone.