1. When using const to define a constant, you can only use scalar initialization; when using define to define a constant, we can use any form of expression to initialize the constant;
2. We can use define in a conditional expression to define a constant , but const is not allowed, for example: defined('DEBUG') or define('DEBUG',true)
3. Const defines a constant that is case-sensitive; define defines a constant through the third parameter to determine whether it is case-sensitive. The third parameter is set to TRUE, indicating case sensitivity;
4. Starting from PHP5.3, const can be used outside the class. In previous versions, const can only be used within the class;
The above has introduced the difference between const and define, including aspects of content. I hope it will be helpful to friends who are interested in PHP tutorials.