The difference between include () and require () in PHP the difference between include () and require () in PHP Postedon2007-09-2913: 38YemooSPHPHome read (13988) comment (0 )? Edit? Collection Reference Category: PHP Basics & lt ;! -- & Lt; difference between include () and require () in rdf: RDFxmlns: rdfhttp PHP
Difference Between include () and require () in PHP Posted on Yemoo's PHP Home Read (13988) Comments (0 )? Edit? Collection Reference Network Abstract Category: basic PHP knowledge
I haven't touched php for a long time, and even forgot some basic things. I read the php document today and see the difference between include and require, I feel this is a very confusing place for beginners. I will record it here for your reference and hope it will be helpful to php friends.
There are two methods to reference files: require and include. The two methods provide different elasticity.
The use of require is as follows:require("MyRequireFile.php");
. This function is usually placed at the beginning of the PHP program. before the PHP program is executed, it will first read the file specified by require to make it a part of the PHP program webpage. This method can also be used to introduce common functions into webpages.
The use of include is as follows:include("MyIncludeFile.php");
. This function is generally placed in the process of process control. The PHP program webpage reads the include file. In this way, you can simplify the process during program execution.