PHP的spl_autoload_register用法

来源:互联网 发布:人肉搜索引擎软件 编辑:程序博客网 时间:2024/06/07 13:34
<?phpclass A{   public static function loadClassFunc($className)   {      $file = $className.'.class.php';      if(is_file($file))      {         require_once($file);      }   }}spl_autoload_register( array('A','loadClassFunc'));//等价于:sql_autoload_register(A::loadClassFunc);$obj = new PRINT();  // PRINT类存在于 PRINT.class.php文件中$obj->func1();?>
0 0