Skip to content

Instantly share code, notes, and snippets.

@matthijs166
Created November 20, 2018 09:43
Show Gist options
  • Save matthijs166/37972b04cd394c9fd306165112f05f7a to your computer and use it in GitHub Desktop.
Save matthijs166/37972b04cd394c9fd306165112f05f7a to your computer and use it in GitHub Desktop.
php load class loader load files in sub dir directory
$subdir = "/modules/";
foreach (scandir(dirname(__FILE__) . $subdir) as $filename) {
$path = dirname(__FILE__) . $subdir . $filename;
if (is_file($path)) {
require_once $path;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment