我的spl_auto_register()函数为什么只能注册一个自动加载函数呢? autoload register 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 两个都可以注册成功,你的autoload函数require之前 先要判断是否是文件啊,亲function __autoload1($className) { $path = 'class/' . $className . ".class.php"; if (is_file($path)) require_once 'class/' . $className . ".class.php";}function __autoload2($phpFile) { $path = $phpFile . ".class.php"; echo $path; if (is_file($path)) require_once $phpFile . ".class.php";}spl_autoload_register('__autoload1');spl_autoload_register('__autoload2');$page = new Page;$person = new Person();print_r($page);print_r($person); 連線關閉問題 php,如何传递类 php怎么连接MySQL数据库 请问我是中毒了吗? 找php程序员做网站,广州,5-8千 javascript可以运行在php服务端么? PHP中一个简单的JAVA脚本问题! php访问access的问题 求一个php新闻系统(找了很久没有找到合适的) 如何安装ADODB? sphinx匹配问题 PHP执行route命令
function __autoload1($className) {
$path = 'class/' . $className . ".class.php";
if (is_file($path))
require_once 'class/' . $className . ".class.php";
}
function __autoload2($phpFile) {
$path = $phpFile . ".class.php";
echo $path;
if (is_file($path))
require_once $phpFile . ".class.php";
}
spl_autoload_register('__autoload1');
spl_autoload_register('__autoload2');
$page = new Page;
$person = new Person();
print_r($page);
print_r($person);