There are two ways to refer to a file: Require and include. Two ways to provide different use elasticity.
Require use methods such as require ("myrequirefile.php");. This function is usually placed at the front of the PHP program, and before the PHP program executes, it is read into the file specified by require to make it a part of the PHP program's Web page. Commonly used functions, you can also use this method to introduce it into the Web page.
Include usage methods such as include ("myincludefile.php");. This function is usually placed in the processing part of the process control. The PHP Program page reads the include file before it is read in. This way, you can simplify the process when the program executes.
PS: The use of two is exactly the same, not necessarily which one is placed at the front and which is in the middle. Their most fundamental difference is that they are not handled in the same way.
Require a file is wrong, then the program will break execution and display a fatal error
Include a file if there is an error, then the program will not be the middle end, but continue to execute, and display a warning error.
http://www.bkjia.com/PHPjc/364520.html www.bkjia.com true http://www.bkjia.com/PHPjc/364520.html techarticle There are two ways to refer to a file: Require and include. Two ways to provide different use elasticity. Require use methods such as require (myrequirefile.php);. This function is usually placed in the ...