What is the difference
Moderator: General Moderators
-
rihitobach
- Forum Newbie
- Posts: 1
- Joined: Wed Jun 03, 2020 4:45 am
What is the difference
Hi there, just a question that looks for your ideas. What is the difference between include_once() and require_once(), which one would you use in circumstances where you need to connect to a database, and why?
Re: What is the difference
This sounds like a test question. Historically we don't answer questions like that. Sorry!
Re: What is the difference
There are some really thorough explanation about these functions/statements online. For example, https://stackoverflow.com/questions/241 ... clude-once.
Personally, I think most of the applications nowadays are using autoloaders which has require_once in most of them I think (funny that the example in PHP manual about autoloading class is using include). If you are interested, you can do some reading about autoloaders articles might be useful for you.
Personally, I think most of the applications nowadays are using autoloaders which has require_once in most of them I think (funny that the example in PHP manual about autoloading class is using include). If you are interested, you can do some reading about autoloaders articles might be useful for you.