php include function

The include() statement will evaluate and include a file into the location where it is called. Including a file produces the same result as copying the data from the file specified into the location in which the statement appears.

include function Syntax :

<?php
  include(/path/to/filename);
?>

Like the print and echo statements, you have the option of omitting the parentheses when using include().

include example :


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

if you want to include a series of predefined functions and configuration variables, you could place them into a separate file(called init.inc.php, for example), and then include that file within the top of each PHP script.





Content