It all depends on the purpose.

With require, the script will die on the spot if the file is not found. 
Also, the code will always be included in the file.. so take this example:

file.php:
<?
    echo "Hello World!";
?>

requiretest.php:
<?
    if (FALSE) {
        require('file.php');
    }
?>

The run script would be:

<?
    if (FALSE) {
        echo "Hello World!";
    }
?>

Of course that code would never be executed, but the required file would 
be parsed and included as part of the file, whereas:

includetest.php:
<?
    if (FALSE) {
        include('file.php');
    }
?>

If the if() condition is not met, the file is not included at all.. so 
the parsed code would be:

<?
    if (FALSE) {
    }
?>

:)

Mike

Oosten, Sjoerd van wrote:

>Hello list,
>
>I'm just wandering what's better, require or include.
>
>Greetings,
>
>________________________________________
>Sjoerd van Oosten 
>Digitaal vormgever [EMAIL PROTECTED]
>Datamex E-sites B.V. 
>http://www.esites.nl
>Minervum 7368 Telefoon: (076) 5 730 730 
>4817 ZH BREDA Telefax: (076) 5 877 757 
>_______________________________________
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to