在PHP中,定义常量的方法有以下几种:
define("CONSTANT_NAME", "constant_value");
const CONSTANT_NAME = "constant_value";
class MyClass {
const CONSTANT_NAME = "constant_value";
}
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
相关推荐:php定义常量的方法是什么