Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static function includeDirectory($dir){
- foreach (scandir($dir) as $entry){
- if($entry == "." or $entry == "..")
- continue;
- // Recursively run functions on subdirectories.
- elseif(is_dir("$dir/$entry"))
- self::includeDirectory("$dir/$entry");
- // Include .php files.
- elseif(strrchr($entry, ".") == ".php")
- include_once "$dir/$entry";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement