brijesh
What are the differences between require and include, include_once?
1 Answer(s)      4 years and 10 months ago
Posted in : PHP

What are the differences between require and include, include_once?

Advertisement
View Answers

November 13, 2010 at 4:44 PM


Hi,

requireonce() and includeonce() are both the functions to include and evaluate the specified file only once. If the specified file is included previous to the present call occurrence, it will not be done again.

But require() and include() will do it as many times they are asked to do.

It?s how they handle failures. If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.

Thanks










Related Tutorials/Questions & Answers:
Advertisements