The require () function is used to the attach (get) all the data from the file . If you want to use another file data on a page so you can use the requre () function. If there is any problem in loading a file, then the require() function generates a fatal error and hold the execution of the script.
. It is recommended to use the require() function instead of include(), because scripts should not continue executing if files are missing or misnamed.
If we have created three file of index page .
Now we will include these files in index.php page .
<html> <body> <?php require("header.php"); ?> <?php require("header.php"); ?> <?php require("header.php"); ?> </body> </html> <