Jump to content

Difference between request() & request_once(), include() & include_once() ?


tmyonline

Recommended Posts

require "file.ext";

 

This will require the file and give an error killing the page like a die() command if it fails or the file has already been required

 

require_once "file.ext";

 

Same as require but command is ignored if the file has already been required.

 

include "file.ext";

 

This will give an error if it fails but continue running the script like the trigger_error() function

 

include_once "file.ext";

 

will be ignored if the file has already been required, give an error if it fails and continue the rest of the script.

 

I think thats how it goes anyway

Just clarifying - You did mean 'require', not 'request'... ?

 

Is there any significant difference or reason why I should use

 

require ("file.ext");

 

versus

 

require "file.ext";

 

nope, require is a "keyword"...just like print...so you can use it with or without the parenthesis

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.