略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: 预定义常量

2024-04-28

预定义常量

每个类描述了它自己的常量。

add a noteadd a note

User Contributed Notes 1 note

up
-29
sadisticnepal3339 at gmail dot com
4 years ago
PHP user-defined constant can be like this:

define('APP',
[
  'name'=>'Sadish',
  'hobby'=>'Coding',
   'occupation'=>'student'
]);

Here, APP is the user-defined constant which is defined using define() function available in PHP.

Also, Simply anything, like this :
  define('APP','Demo PHP');
is a user-defined constant, which basically replaces any code available in PHP named as APP with the value 'Demo PHP'.

官方地址:https://www.php.net/manual/en/reflection.constants.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3