21,886
社区成员
发帖
与我相关
我的任务
分享
<?php
$dir = 'd:/web/system/autofile/'; // 这个目录下只有一个文件 logincheckentry.php
if ($dh = opendir($dir))
{
while (($autofile = readdir($dh)) !== false)
{
//略过linux目录的名字为'.'和‘..'的文件
if($autofile != '.' && $autofile != '..')
{
//strrchr() 函数查找字符串在另一个字符串中最后一次出现的位置,并返回从该位置到字符串结尾的所有字符
$fix = substr(strrchr($autofile, '.'), 1);
if($fix == 'php')
{
require_once $dir.$autofile;
} //加载文件,把文件写入编译HX110里
}
}
closedir($dh);
}
class logincheckentry{
function __construct(){
$this->index();
}
function index()
{
echo "加载成功";
}
}