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
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
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
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
-Original Message-
From: Jim Lucas [php] [mailto:[EMAIL PROTECTED]]
Sent: 15 March 2002 00:55
Plus, depending on how you are calling the file. Meaning if
the file name
that you are calling is a static file name or dynamic file name
require() and require_once() will include a
Are these redundant functions or are they different? I seem to be able
to use the interchangeably.
David McInnis
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
They are much the same, both include a file.
To quote the PHP manual 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
Message -
From: SHEETS,JASON (Non-HP-Boise,ex1) [EMAIL PROTECTED]
To: 'David McInnis' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, March 14, 2002 3:56 PM
Subject: RE: [PHP] require() vs include()
They are much the same, both include a file.
To quote the PHP manual require() and include
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
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
, March 17, 2001 9:44 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Require vs include
Hi
Can someone explain me what's the difference between include() and require()
??
I did not catch the explanation in the docs.
When should I use include() and when should I use require() ??
I'm not on the list so reply
Hi
Can someone explain me what's the difference between include() and require() ??
I did not catch the explanation in the docs.
When should I use include() and when should I use require() ??
I'm not on the list so reply me to: [EMAIL PROTECTED]
Thnx
--
12 matches
Mail list logo