Sommaire

Options PHP et informations

assert
assert-options
extension_loaded
dl
getenv
get_cfg_var
get_current_user
get_defined_constants
get_extension_funcs
getmygid
get_included_files
get_loaded_extensions
get_required_files
get_magic_quotes_gpc
get_magic_quotes_runtime
getlastmod
getmyinode
getmypid
getmyuid
getrusage
ini_alter
ini_get
ini_get_all
ini_restore
ini_set
phpcredits
phpinfo
phpversion
php_logo_guid
php_sapi_name
php_uname
putenv
set_magic_quotes_runtime
set_time_limit
zend_logo_guid
version_compare
zend_version

6.75.8 get_defined_constants

PHP 4 >= 4.0.7RC1

Description

array get_defined_constants(void)

get_defined_constants retourne les noms et valeurs des constantes déjà définies. Cela inclut les constantes créées par les extensions, et celles créées avec la fonction define.

Par exemple :@:

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

Array
(
    [E_ERROR] =&gt; 1
    [E_WARNING] =&gt; 2
    [E_PARSE] =&gt; 4
    [E_NOTICE] =&gt; 8
    [E_CORE_ERROR] =&gt; 16
    [E_CORE_WARNING] =&gt; 32
    [E_COMPILE_ERROR] =&gt; 64
    [E_COMPILE_WARNING] =&gt; 128
    [E_USER_ERROR] =&gt; 256
    [E_USER_WARNING] =&gt; 512
    [E_USER_NOTICE] =&gt; 1024
    [E_ALL] =&gt; 2047
    [TRUE] =&gt; 1
)

Voir aussi get_loaded_extensions.