PHP中的constant()函数
该constant()函数返回常量的值。
语法
constant(const)
参数
const-要检查的常量的名称
返回
该constant()函数返回常量的值,如果未定义常量,则返回NULL。
示例
以下是定义常量的示例。
<?php
define("myConstant","就是这个!");
echo constant("myConstant");
?>输出结果
以下是输出。
就是这个!
该constant()函数返回常量的值。
constant(const)
const-要检查的常量的名称
该constant()函数返回常量的值,如果未定义常量,则返回NULL。
以下是定义常量的示例。
<?php
define("myConstant","就是这个!");
echo constant("myConstant");
?>输出结果
以下是输出。
就是这个!