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?
>
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. inclu
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
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 requi
4 matches
Mail list logo