*/ function autoInclude(string $directoryToInclude) { foreach (scandir($directoryToInclude) as $filename) { $filepath = str_replace('\\', '/', $directoryToInclude . '/' . $filename); $filepathThis = str_replace('\\', '/', __FILE__); if (is_file($filepath) && $filepathThis !== $filepath) { require $filepath; } } }