П О Р Т А Л                            
С Е Т Е В Ы Х                          
П Р О Е К Т О В                        
  
                                                 
Главная

О проекте

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

MySQL

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

Хостинг

Другое







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

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

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

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

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

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

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

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

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

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

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

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



 
 



Руководство по PHP
Пред. Глава 16. Control Structures След.

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. include() produces a Warning while 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.

Пример 16-4. Basic require() examples

<?php

require 'prepend.php';

require
$somefile;

require (
'somefile.txt');

?>

See the include() documentation for more examples.

Замечание: Prior to PHP 4.0.2, the following applies: require() will always attempt to read the target file, even if the line it's on never executes. The conditional statement won't affect require(). However, if the line on which the require() occurs is not executed, neither will any of the code in the target file be executed. Similarly, looping structures do not affect the behaviour of require(). Although the code contained in the target file is still subject to the loop, the require() itself happens only once.

Замечание: Поскольку это языковая конструкция, а не функция, она не может вызываться при помощи переменных функций

Внимание

Версии PHP для Windows до PHP 4.3.0 не поддерживают возможность использования удаленных файлов этой функцией даже в том случае, если опция allow_url_fopen включена.

See also include(), require_once(), include_once(), eval(), file(), readfile(), virtual() and include_path.



 





Copyright © 2005-2011 Project.Net.Ru