Definition and Usage
定义和用法

The defined() function checks whether a constant exists.
defined()函数的作用是:检查一个常量是否存在。

Returns TRUE if the constant exists, or FALSE otherwise.
如果该常量存在,则返回True;如果不存在,则返回False。

Syntax
语法

defined(name)
Parameter
参数
Description
描述
name Required. Specifies the name of the constant to check
必要参数。指定常量对象的名称

Example
案例

<?php
  
define("GREETING","Hello you! How are you today?");
  
echo defined("GREETING");
?> 

 

 

The output of the code above will be:
上述代码将输出下面的结果:

1

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2021-11-28
猜你喜欢
  • 2022-12-23
  • 2021-08-27
  • 2021-11-28
  • 2021-12-24
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案