require_once 


php128 apg

The require_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.

require_once is similar to require statement, with the only difference being that if the code from a file has already been included, it will not be included again.

The file is included just once.

require_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.



<?php

    
require_once

    
This file is intended to contain 
    all the elements necessary 
    
for the current programming environment.
    
    
This involves: 
    
functions, objects, user constants, etc.
    
    
In short, all the elements 
    that can be constantly used 
    in this environment
.

?>