The role of Include_once and require_once is similar, that is, in the inclusion of the time to check whether the contained files have been included, if included, then do not execute, otherwise included. The reason I said this first is because if you put the include, Require figured it out. That's fine.
Now the difference between include and require:
The Require () function contains content that is considered a part of the current file, so the PHP script for the current file is no longer executed when there is a syntax error in the included file or the file does not exist.
The Include () function is the equivalent of specifying the path to the file, which does not affect the program's operation when the contained file is in error.
The Include function can be judged whether it is included, and require is included in any case. So this is worth noting!
It is recommended that you include dynamic files, which are variables, functions, and already classes. But some time ago, someone was analyzing the efficiency of the execution of two functions. I didn't test it myself.
http://www.bkjia.com/PHPjc/319423.html www.bkjia.com true http://www.bkjia.com/PHPjc/319423.html techarticle The role of Include_once and require_once is similar, that is, in the inclusion of the time to check whether the contained files have been included, if included, then do not execute, otherwise included. I'll say this first .