Re: [PHP] require or include ?

2002-03-28 Thread bvr


both include the file, but
use require() when it is required, and include() when it's not.

In the new behaviour these two make no further difference.

bvr.

Javier wrote:

>If I include for ex. common.php in a script and this script also calls
>common.php what should I use require or include?
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] require or include ?

2002-03-28 Thread Javier


If I include for ex. common.php in a script and this script also calls
common.php what should I use require or include?


On Thu, Mar 28, 2002 at 04:44:04PM -0600, Rick Emery wrote:
> require() is used when you want the file included regardless of whether any
> information is used from it.  include() may be conditional.
> 
> -Original Message-
> From: javier [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 28, 2002 4:44 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] require or include ?
> 
> 
> When should I use require or include?
> I read that include copies the content from the file to the script that
> is calling it.
> And require is like #include in C.
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] require or include ?

2002-03-28 Thread Rick Emery

require() is used when you want the file included regardless of whether any
information is used from it.  include() may be conditional.

-Original Message-
From: javier [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 28, 2002 4:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP] require or include ?


When should I use require or include?
I read that include copies the content from the file to the script that
is calling it.
And require is like #include in C.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] require or include ?

2002-03-28 Thread javier

When should I use require or include?
I read that include copies the content from the file to the script that
is calling it.
And require is like #include in C.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] require or include

2001-11-15 Thread Mike Eheler

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:


requiretest.php:


The run script would be:



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 the if() condition is not met, the file is not included at all.. so 
the parsed code would be:



:)

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]




[PHP] require or include

2001-11-15 Thread Oosten, Sjoerd van

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]