|
|||||||||
|
|||||||||
require()The require() statement includes and evaluates the specific file. require() includes and evaluates a specific file. Detailed information on how this inclusion works is described in the documentation for include(). require() and include() are identical in every way except how they handle failure. They both produce a Warning, but require() results in a Fatal Error. In other words, don't hesitate to use require() if you want a missing file to halt processing of the page. include() does not behave this way, the script will continue regardless. Be sure to have an appropriate include_path setting as well.
Пример #1 Basic require() examples
<?phpSee the include() documentation for more examples.
Внимание
Версии PHP для Windows до PHP 4.3.0 не поддерживают возможность использования удаленных файлов этой функцией даже в том случае, если опция allow_url_fopen включена. See also include(), require_once(), include_once(), get_included_files(), eval(), file(), readfile(), virtual() and include_path. | |||||||||
|
|||||||||