文章详情页
为什么autoloader.php文件能知道 $className 代表test
问题描述
function __autoload($className)
{
$path = $className.'.php'; //test.php
if (file_exists($path)) {
require_once($path);
}else {
echo $path."不存在,请检查~~";
}
}
问题解答
回答1:autoload()是自动加载函数,$className中文意思是类名,而且$className是变量,你传什么值就是xxxx.php
相关文章:
1. python - django 按日归档统计订单求解2. python - 如何将文本文件的CR换行符换成LF换行符?3. Python中如何将爬取到的数据循环存入到csv文件中?4. Python3 with open 怎样处理文件不存在的异常?5. js怎样实现在类似qq的联系人分组中进行搜索后,又可恢复原分组的界面?6. python3.x - Python3 socket sendall出现100577. python 中的类变量8. python - scrapy-redis爬虫运行是连接redis数据库连接错误9. 怎样用python给mp3添加封面?10. 【python小白】 问关于之初始化一次对象的问题
排行榜