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:
from this point new file begin
Variables in PHP
PHP Concatenation
Calculation in PHP
If Statements in PHP
if ... else Statements in PHP
Nested IF Structure in PHP
PHP Comparison Operators
Switch Statement in PHP
Logical Operators In PHP
PHP Booleans
FOR Loop in PHP
While Loop In PHP
foreach Loop In PHP
Break Statement
Array In PHP
Associative Array
The Count function
Changing Case Function
Trim Function In PHP
Str_shuffle( ) function
strpos function in PHP
Explode() Function in PHP
Function
Passing Function Arguments
Server Variables
Header Function
Include Function
The require Function