Including files relative to the current file : include « Utility Function « PHP






Including files relative to the current file

 
<?php
$currentDir = dirname(__FILE__);
include $currentDir . '/functions.php';
include $currentDir . '/classes.php';
?>
  
  








Related examples in the same category

1.Behavior of Files Included Using include
2.Including Other Files
3.Using include to Load Files in PHP
4.Using include() Within a Loop
5.Using include() to Execute PHP and Assign the Return Value