Function in PHP

Require Function in PHP

Require function in PHP work same as include function work. Require function copy all the contents of one PHP file in other PHP file. There is no difference in require function and include function except the process of handling the error. For example In include function If any error occur in loading a file then the include function generates a warning but the remaining script will be execute. But in Require function If there is any problem in loading a file then the require function generates a fatal error and stop the remaining execution of the script.
For example
if you have a common menu for your web site then make a file which contain some content of your menu and then just include on the top of you every file.
For Example if your menu file is menue.php then
when you want to include this file in new file then your code will be:


<html>

<body>

<?php

require "menue.php" ;

?>

<p> from this point new file begin </p>

</bod>

</html>