PHP constant() 函数

PHP 教程 · 2019-01-27 11:42:17

实例

返回一个常量的值:

<?php
//define a constant
define("GREETING","Hello you! How are you today?");

echo constant("GREETING");
?>

定义和用法

constant() 函数返回一个常量的值。

注释: 该函数也适用于 class 常量。

语法

constant(constant)

参数 描述
constant 必需。规定要检查的常量的名称。

技术细节

返回值: 返回常量的值,如果常量未定义则返回 NULL。
PHP 版本: 4+

点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

The Art and Science of Java

The Art and Science of Java

Eric Roberts / Addison-Wesley / 2007-3-1 / USD 121.60

In The Art and Science of Java, Stanford professor and well-known leader in CS Education Eric Roberts emphasizes the student-friendly exposition that led to the success of The Art and Science of C. By......一起来看看 《The Art and Science of Java》 这本书的介绍吧!

MD5 加密
MD5 加密

MD5 加密工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具