Last active
August 29, 2015 14:16
-
-
Save noname007/86fa1fe01878b8ccee6a to your computer and use it in GitHub Desktop.
spl_autoload_register类的自动加载
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function import($classname) | |
{ | |
$filename = __DIR__.'/class/'.$classname.'.php'; | |
if(is_file($filename)) | |
{ | |
require $filename; | |
}else { | |
die('Not Find the file '.$filename); | |
} | |
} | |
spl_autoload_register('import'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment