ricod1996

includer.php

Jun 12th, 2013
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.28 KB | None | 0 0
  1. <?php
  2.  
  3. function includeAllFromDir($dirname)
  4. {
  5.     foreach(scandir($dirname) as $file)
  6.     {
  7.         if(!in_array($file, array('.', '..')))
  8.         {
  9.             if(is_dir($file))
  10.                 includeAllFromDir($file);
  11.             else
  12.                 include_once($file);
  13.         }
  14.     }
  15. }
  16.  
  17. includeAllFromDir(dirname(__FILE__));
  18.  
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment