require() operates like include(), including a template. : require « Utility Function « PHP






require() operates like include(), including a template.

 
It has this syntax: require(file insertion_file)

The insertion_file will be included in the script. 

// A sample file to be inserted (init.tpl)
<?
$site_title = "PHP";
$contact_email = "w@hotmail.com";
$contact_name = "Sales";
?>

//Making use of init.tpl

<? require ('init.tpl'); ?>
  
  








Related examples in the same category

1.Using require to Load Files in PHP