include_once 


php128 apg

The include_once statement includes and evaluates the specified file.





Usually this file is stored in the include_path which is set in the php.ini, however, it can be in any other path as long as known.

include_once is similar to include statement, with the only difference being that if the code from a file has already been included, it will not be included again, and include_once returns TRUE.

The file is included just once.


include_once may be used in cases where the same file might be included and evaluated more than once during a particular execution of a script, so in this case it may help avoid problems such as function redefinitions, variable value reassignments, etc.

Since PHP 4.0.0 the include_once functionality differs with case-insensitive operating systems, this means that uppercase and lowercase in file names to be included are considered identical.

Under PHP 5.0.0 this behavior was changed, so for example with Windows™ the path is normalized first so that C:\PROGRA~1\A.php is realized the same as C:\Program Files\a.php and the file is included just once.



<?php

    
include_once

    
This file is intended to contain 
    all the elements necessary 
    
for the current programming environment.
    
    
This involves
    
functionsobjectsuser constantsetc.
    
    
In shortall the elements 
    that can be constantly used 
    in this environment
.

?>