The following are the differences between the include () statement and the Require () statement in the PHP code:
1. Different loading mode and error handling mode
The include () statement can be placed in the process control of the program, and when the program executes, the file is loaded in. When an error occurs (such as a file does not exist) only a warning is generated
The Require () statement is usually placed at the beginning of the program and is now loaded into the program at execution time. Terminating the script when an error occurs, such as when the file does not exist.
2.php Performance
- The inlcude () statement reads and evaluates files every time they are executed.
- The Require () statement performs a file processing only once (in effect, the file contents replace the Require () statement.
3.include_once () and require_once ()
Include_once () includes and runs the file during the script execution period and will not be included again if the file is already included.
Require_once () checks whether the file has been loaded at the time of script execution. If the load is not loaded again, such as a file defined a type, if the file is loaded two times an error occurs
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
'). Text (i)); }; $numbering. FadeIn (1700); }); });
The above introduces the differences between include and require in PHP, including the contents of the content, I hope that the PHP tutorial interested in a friend helpful.