April 9, 2008...6:16 pm

require() in php

Jump to Comments

require() function include and evaluate the specific file.

Use require() if you want a missing file to halt the processing of the page.

Note: include() does not behave this way, the script will continue regardless.

Sample:

<?php

require 'prepend.php';

require $somefile;

require ('somefile.txt');

?>

Leave a Reply