The role of include and require is to insert the contents of the PHP file into another PHP program before the server executes it.
The syntax is the same (both language constructs), and the difference is in dealing with errors: require generates a fatal error and stops execution, and the include generates only a warning and resumes execution of the script.
The reason: Require this language structure is usually placed at the top of the PHP program, the PHP program before execution, will be read into the require specified by the introduction of the file to make it a part of the PHP program; Include this language structure is generally placed in the process control of the processing section, When the PHP program reads the include file, it is read in, which simplifies the process of executing the program.
General recommendations for global content use require at the beginning of the program. Use include when it is used.
The different processing methods after an error result in a slightly different usage, and if you want to continue and output the results to the user, use include if the included files are missing, or if the included files are important, or to ensure page completion and security, then use require.
The difference between require_once and require (Inlcude and include_once)
The role of _once is to prevent multiple calls to the same file, increasing the burden on the server.
PHP contains the difference between the file statement include and require