If you have duplicate code in multiple files, you can write this part of the code to a file, and then include the file in the desired place. Note that in this file, you only need these duplicate code, and do not need any other format or anything, the filename can be random, suffix can not be.
By using the Include file, you can easily include the same content on multiple pages in your own site. An include file is a file that is dynamically included in a Web page when it is rendered in a browser.
Include files to simplify the administration of your site. For example, you can create content such as page banners, site information blocks, or menus that you want to include on multiple pages in your site. This way, when you need to change the content, you only have to make changes in a single file, and the changes are reflected on each page where the containing file resides.
The PHP include statement is a block of code that extracts the contents of an external file into a Web page. The following is an example of two PHP include statements:
<?php include (' aa.php ');?>
<?php include_once "./side/side";?>
There are two basic PHP include functions:include () and require (). The two behave the same way, but the errors are returned differently. The include () function continues to process the rest of the page, even if it is not parsed correctly, and displays a warning in the Web page where the containing file should be displayed. If the require () function references a missing file, the function stops processing the page and displays the error page in the browser.
The include_once () and require_once () functions specify that an include file can be used only once in a Web page. If the two include () functions refer to the same include file, only the first include () function is displayed in the browser.
Microsoft Expression Web support uses four different files as include files: HTML, INC, PHP, and TXT files. In addition, you can create nested include files. For example, you can create an include file that includes a reference to another include file.