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

查看所有标签

Looking For a Challenge

Looking For a Challenge

the University of Warsaw / the University of Warsaw / 2012-11 / 0

LOOKING FOR PROGRAMMING CHALLENGES? Then this book is for you! Whether it's the feeling of great satisfaction from solving a complex problem set, or the frustration of being unable to solve a task,......一起来看看 《Looking For a Challenge》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器