search
Homephp教程php手册php中get_defined_constants函数用法实例分析,vb随机函数用法和实例

php中get_defined_constants函数用法实例分析,vb随机函数用法和实例

本文实例讲述了php中get_defined_constants函数用法。分享给大家供大家参考。具体分析如下:

get_defined_constants ( PHP 4中 > = 4.1.0 , PHP 5中)

get_defined_constants -返回一个关联数组的名字所有的常量和他们的价值观

描述

阵列get_defined_constants ( [布尔$归类] )

返回名称和值的所有当前定义的常量。这包括设立的扩展以及创建的define()函数。

参数

分类

造成这个函数返回多维阵列类别中的第一项维和常量和他们的价值观中的第二个方面。

<&#63;php
define("MY_CONSTANT", 1);
print_r(get_defined_constants(true));
&#63;> 
The above example will output something similar to:
Array
(
  [internal] => Array
    (
      [E_ERROR] => 1
      [E_WARNING] => 2
      [E_PARSE] => 4
      [E_NOTICE] => 8
      [E_CORE_ERROR] => 16
      [E_CORE_WARNING] => 32
      [E_COMPILE_ERROR] => 64
      [E_COMPILE_WARNING] => 128
      [E_USER_ERROR] => 256
      [E_USER_WARNING] => 512
      [E_USER_NOTICE] => 1024
      [E_ALL] => 2047
      [TRUE] => 1
    )
  [pcre] => Array
    (
      [PREG_PATTERN_ORDER] => 1
      [PREG_SET_ORDER] => 2
      [PREG_OFFSET_CAPTURE] => 256
      [PREG_SPLIT_NO_EMPTY] => 1
      [PREG_SPLIT_DELIM_CAPTURE] => 2
      [PREG_SPLIT_OFFSET_CAPTURE] => 4
      [PREG_GREP_INVERT] => 1
    )
  [user] => Array
    (
      [MY_CONSTANT] => 1
    )
)

希望本文所述对大家的php程序设计有所帮助。

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment