include once function

The include_once() function has the same purpose as include() except that it first verifies whether the file has already been included.

include once syntax:

<?php
 include_once (filename);
?>

If a file has already been included, include_once() will not execute. Otherwise, it will include the file as necessary. Other than this difference, include_once() operates in exactly the same way as include(). The same quirk pertinent to enclosing include() within conditional statements also applies to include_once().

include once example :


<?php
 include_once "includes/left.inc.php";
 /* the script continues here */
?>

left.inc.php

left.inc.php is a File.