Includerequire differences in php 1. include generates a warning when introducing non-stored files and the script will continue to be executed,
Require may cause a fatal error and the script is stopped.
2. include () is a conditional include function, while require () is an unconditional include function.
3. include has a return value, while require does not
4. read and evaluate the files to be referenced during include () execution,
Require () only processes the file to be referenced once during execution (the file content to be referenced in actual execution replaces the require () statement)
It can be seen that if there is code containing one of these commands and code that may be executed multiple times, the use of require () is more efficient,
If different files are read each time the code is executed, or there is a loop through a set of file stacks, use include (),
Require is usually used. This function is usually placed at the beginning of the PHP program. before the PHP program is executed, it will first read the file specified by require, make it a part of the PHP web page. This method can also be used to introduce common functions into webpages.
Include is usually used. This function is generally placed in the processing part of process control. The PHP program webpage reads the include file. In this way, you can simplify the process during program execution.