php常量的定义方式有哪些

使用 define() 函数定义常量

define("CONSTANT_NAME", "constant value");

使用 const 关键字定义类常量

class MyClass {
    const CONSTANT_NAME = "constant value";
}

使用 define() 函数定义数组常量

define("FRUITS", [
    "apple",
    "banana",
    "orange"
]);
阅读剩余
THE END