预定义常量

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

User Contributed Notes

sadisticnepal3339 at gmail dot com 27-Mar-2018 11:35
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'.
PHP8中文手册 站长在线 整理 版权归PHP文档组所有