See online about require and include how to choose, pro-Test and summed up a bit:
1. The _once suffix indicates that loading is not repeated.
2. Error:
- When the include introduces a file, if it encounters an error, it throws a hint and continues to run the code below (Warning);
- Require when the file is introduced, if it encounters an error, it throws a hint and stops running the code below (Fatal error);
3. Practice:
Require-contains functions and variables. Usually placed at the beginning of the program, the PHP program before execution, will be read into the require designated by the introduction of the file to become a part of the Web page.
Include-is usually placed in the processing part of the process control to streamline the process. The PHP Program page reads the include file before it is read in.
4. the following rules apply before PHP 4.0.2:
require require require require require
5. Return value:
Although the include () and require () will return 1 after a successful reference, the $ret = include (' foobar.php ') will only make sense if require () is fatal if the reference fails.