Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7770341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:23:11+00:00 2026-06-01T16:23:11+00:00

Could you please tell me which one (include or require once) is it better

  • 0

Could you please tell me which one (include or require once) is it better to use. As I have read require_once is preffered as it stops the execution after an error. It depends of what you want to include, right? Also using include and require makes the code to be more effective? As I can understand the incude and require just make the code more clear(helping to avoid repeating parts of code), effectiveness is not achieved as the same code is added in each file. Finally, I have some javascript code in each of my files(different javascript code in each file) Is it a good idea to put all the javascript code from all of my pages into one file and just include this file in each page? Thank you in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T16:23:12+00:00Added an answer on June 1, 2026 at 4:23 pm

    For your JS questions, do separate questions.

    It’s simple for me:

    include_once

    Only use if your script will continue without the included script, without errors or odd behaviors (rare).

    require_once

    Use if your script needs the required file, such as database connection details or anything of the sort.

    If your error_level is set appropriately this shouldn’t pose a problem/issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could you please tell me what are the various functions which we could use
could you please tell me which one of these two sentences is faster? 1st
Could someone please tell me which objects types can be tested using Regular Expressions
Could somebody please tell me what is Memory Page Out Rate. I have seen
Could anyone please tell what are the important use cases of IdentityHashMap ?
Could you please tell me how can one escape an apostrophe. I need it
I have more than one doubt so please bear with me. Can someone tell
Could anybody please tell me what's the relation between log4j and apache.commons.logging ? which
Could anyone please tell me why the following line about filter init method invocation
could anyone please tell me, where in Javascript the difference between MyClass.prototype = new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.