Defining Extra Include Paths


/ Published in: PHP
Save to your folder(s)

This snippet shows a dynamic way to enable extra default include paths.


Copy this code and paste it in your HTML
  1. <?php
  2.  
  3. define('APPLICATION_PATH', realpath("../"));
  4. $paths = array(
  5. APPLICATION_PATH,
  6. APPLICATION_PATH . "/classes",
  7. APPLICATION_PATH . "/functions",
  8. );
  9.  
  10. set_include_path(implode(PATH_SEPARATOR, $paths));
  11.  
  12. require_once ('functions.php');
  13.  
  14.  
  15. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.