Include Files in PHP
Include
files
The include()
function is used to call an external file from your server or any different
server.
Syntax
The general syntax for a basic include is as follows
<?php include("otherfile.txt"); ?>
This includes a file called otherfile.txt from the same directory on your server.
You can also use it like this
<?php include("http//www.myothersite/otherfile.txt"); ?>
This means you can share the same file on more than one site .
Advantages
The main advantage of include function is reuseability. For example, you have
a developed a taf form like taf.php and you want to use this file more than
50 pages. you can use this taf form only include function e.g.
<?=include("head.php");?>
