П О Р Т А Л                            
С Е Т Е В Ы Х                          
П Р О Е К Т О В                        
  
Поиск по сайту:
                                                 
Главная

О проекте

Web-мастеру
     HTML & JavaScript
     SSI
     Perl
     PHP
     XML & XSLT
     Unix Shell

MySQL

Безопасность

Хостинг

Другое








Самое читаемое:

Учебник PHP - "Для Чайника".
Просмотров 3525 раз(а).

Иллюстрированный самоучитель по созданию сайтов.
Просмотров 6122 раз(а).

Учебник HTML.
Просмотров 3276 раз(а).

Руководство по PHP5.
Просмотров 5499 раз(а).

Хостинг через призму DNS.
Просмотров 4150 раз(а).

Подборка текстов стандартных документов.
Просмотров 55774 раз(а).

Учебник PHP - Самоучитель
Просмотров 3093 раз(а).

Документация на MySQL (учебник & справочное руководство)
Просмотров 5762 раз(а).

Внешние атаки...
Просмотров 3843 раз(а).

Учебник PHP.
Просмотров 2826 раз(а).

SSI в примерах.
Просмотров 37463 раз(а).



 
 
| Добавить в избранное | Сделать стартовой | Помощь





Руководство по PHP
Пред. След.

get_defined_constants

(PHP 4 >= 4.1.0, PHP 5)

get_defined_constants --  Returns an associative array with the names of all the constants and their values

Description

array get_defined_constants ( [mixed categorize] )

This function returns the names and values of all the constants currently defined. This includes those created by extensions as well as those created with the define() function.

For example the line below:

<?php
print_r
(get_defined_constants());
?>

will print a list like:

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
)

As of PHP 5, an additional parameter, categorize, may be passed, causing this function to return a multi-dimensional array with categories in the keys of the first dimension and constants and their values in the second dimension.

<?php
define
("MY_CONSTANT", 1);
print_r(get_defined_constants(true));
?>

Результатом выполнения данного примера будет что-то подобное:

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
)

)

Замечание: The value of the categorize parameter is irrelevant, only its presence is considered.

See also defined(), get_loaded_extensions(), get_defined_functions(), and get_defined_vars().


Пред. Начало След.
get_current_user Уровень выше get_extension_funcs


Если Вы не нашли что искали, то рекомендую воспользоваться поиском по сайту:
 





Copyright © 2005-2016 Project.Net.Ru