include, include_once & require in PHP 5

-

Introduction

There are a number of built in functions that can be used to load external files into PHP scripts. Each of the functions may seem to perform the same function but there are key differences:

Using 'include'

<?php
  include 'WebDeveloper.php';
?>

The above code will include the file every time it is called.

Using 'Include_once'

<?php
  require 'WebDeveloper.php';
?>

The above code will include the file only once (if the same script tries to include the script twice then it will be ignored).

Using 'Require'

<?php
  require 'WebDeveloper.php';
?>

The above code will include the file but if the file is not available PHP will throw an error.

Your comments.