Рекурсивный акроним словосочетания «PHP: Hypertext Preprocessor»
Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетил 17221 программист и 1835 роботов. Сейчас ищут 1563 программиста ...
PHP_Compat::loadConstant
Вернуться к: PHP_Compat
PHP_Compat::loadConstant
PHP_Compat::loadConstant() – Load a constant, or an array of constants
Synopsis
require_once 'PHP/Compat.php';
mixed PHP_Compat::loadConstant ( mixed $constant )
Loads a constant, or an array of constants.
Parameter
- mixed $constant
The name, or an array of names, of constants to load
Return value
mixed
- TRUE if the constant was loaded.
- FALSE if the constant was not loaded. Either unable to be included or already defined.
- If you specified an array of constants to load, an array of TRUE/FALSE values is returned.
Example
Loading a constant with the class:
<?php
require_once 'PHP/Compat.php';
// load E_STRICT
PHP_Compat::loadConstant('E_STRICT');
// load E_STRICT, and PATH_SEPATATOR
PHP_Compat::loadConstant(array('E_STRICT', 'PATH_SEPARATOR'));
// load the STD group of constants (STDIN, STDOUT, STDERR)
PHP_Compat::loadConstant('STD');
?>
You may also load a constant without using the class.
Loading a constant manually:
<?php
require_once 'PHP/Compat/Constant/E_STRICT.php';
?>
Note
This function should be called statically.
Вернуться к: PHP_Compat