Require, such as: Require ("myfile.php"), require statements are usually placed at the very front of the PHP script. Before the PHP program executes, it will read into the file introduced by the Require () statement, making it part of the php script file.
Include uses the same method as require, such as include ("myfile.php"), while the include statement is generally placed in the Process Control section. The php script file is read into the include () statement before the file it contains. This way, you can simplify the process of executing the program.
The include is loaded when it is used.
Simply put, require is loaded at the beginning; Loaded when the include is used.
In addition, when the include introduces a file, if it encounters an error, it will give a hint and continue to execute the code below; Require when the file is introduced, if it encounters an error, it will give a hint and stop running the code below.
The Require and include plus _once suffixes indicate that the load is not loaded.
The difference between include and require in PHP