php中get_defined_constants函数用法实例分析_PHP教程

WBOY
Freigeben: 2016-07-13 09:53:36
Original
714 Leute haben es durchsucht

php中get_defined_constants函数用法实例分析

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

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

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

  描述

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

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

  参数

  分类

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

  ?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

define("MY_CONSTANT", 1);

print_r(get_defined_constants(true));

?>

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程序设计有所帮助。

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1000110.htmlTechArticlephp中get_defined_constants函数用法实例分析 本文实例讲述了php中get_defined_constants函数用法。分享给大家供大家参考。具体分析如下: get_define...
Verwandte Etiketten:
Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!