摘要: php自动载方法有两种.第一种方案用__autoload,这个函数较简单,也较弱.但有一问题没有解决, 就是在include前判断文件是否存在的问题.set_include_path('aa' . PATH_SEPARATOR . get_include_path());function __autoload($className){ //如果加这个检测, 因为此文件不在当前目录下,它就会检测不到文件存在, //但include是能成功的 if (file_exists($className . '.php')) { include_once($classNam 阅读全文
posted @ 2010-06-19 09:55 Yuxing 阅读(13903) 评论(1) 推荐(4) 编辑