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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.