您的位置:首页技术文章
文章详情页

为什么autoloader.php文件能知道 $className 代表test

【字号: 日期:2022-06-07 16:25:00浏览:63作者:猪猪

问题描述

function __autoload($className)

{

$path = $className.'.php'; //test.php

if (file_exists($path)) {

require_once($path);

}else {

echo $path."不存在,请检查~~";

}

}

问题解答

回答1:

autoload()是自动加载函数,$className中文意思是类名,而且$className是变量,你传什么值就是xxxx.php

相关文章: