function __autoload($filename){ $file="libs/class.".$filename.".php"; if(is_file($file)) { include $file; return; } }
class libs{ public static function autoload($filename){ $file="libs/class.".$filename.".php"; if(is_file($file)) { include $file; return; } } } spl_autoload_register('libs::autoload');