- 使用 define() 函数定义常量
define("CONSTANT_NAME", "constant value");- 使用 const 关键字定义类常量
class MyClass {const CONSTANT_NAME = "constant value";}- 使用 define() 函数定义数组常量
define("FRUITS", ["apple","banana","orange"]);上一篇:c语言isdigit函数的用法是什么
下一篇:php如何防止直接访问
php
define("CONSTANT_NAME", "constant value");class MyClass {const CONSTANT_NAME = "constant value";}define("FRUITS", ["apple","banana","orange"]);