Skip to content

Instantly share code, notes, and snippets.

@arvindsvt
Last active February 4, 2018 05:41
Show Gist options
  • Save arvindsvt/fd411907576bcbcdf63241165b55f821 to your computer and use it in GitHub Desktop.
Save arvindsvt/fd411907576bcbcdf63241165b55f821 to your computer and use it in GitHub Desktop.
spl_autoload_register(function($class) {
$ns = explode('\\', strtolower($class));
$class = array_pop($ns);
$ns = implode('\\', $ns) . '\\';
require_once __DIR__ . '\\' . $ns . 'class.' . $class . '.php';
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment