|
Code inclusion from a file |
|
|
|
Sometimes it is necessary to load the same file in different scripts and thus not to repeat the same code in diverse scripts. It seems then reasonable that some method must exist or forms of loading some external file and thus to generate more dynamic web pages.
To this effect PHP he has two instructions to be able to load files:
require (I "file");
When a file is included with require the interpreter leaves the way PHP and enters way HTML, as soon as the file was opened includes it up to his last line and later it leaves the way HTML to return to posicionarse in the way PHP. His principal difference with include () is that it does not allow the conditional load.
include (I "file");
When a file is included with require the interpreter leaves the way PHP and enters way HTML, as soon as the file was opened includes it up to his last line and later it leaves the way HTML to return to posicionarse in the way PHP. The conditional load allows, that is to say, that we can load a file or other if a condition is fulfilled or not.
|