3
Contributors
2
Replies
3
Views
12 Years
Discussion Span
Last Post by Black Knight
0

They are almost the same thing. The differences are if you use require and the file you are requiring doesnt exist, php will give you a fatal error and will stop loading the page. if you use include, it will just give you a warning error but will continue with the rest of the script, and also any file using require() cannot return a value, so using include() is better.

0

require (or require_once) is usually used when you have database connections in seperate files. This stops it duplicating any connections

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.