标签:
类的自动加载后直接实例化
//自动加载类
function my_autoloader($class) {
include $class . ‘Class.php‘;
}
spl_autoload_register(‘my_autoloader‘);
$test=new test();
$test->getvalue();
引入文件的时候直接写文件名称不需要添加路劲
/**
**set_include_path可以直接先设置path的值后面直接调用该路径下的文件
**PATH_SEPARATOR文件分割转义
**/
set_include_path(get_include_path().PATH_SEPARATOR."C:/wamp/www/test/class/");
include("AbstractTest.class.php");
标签:
原文地址:http://www.cnblogs.com/huixingwo/p/4476810.html