0
我正在尝试读取文件名current.conf,然后使用保存在其中的文件夹的名称来运行opendir();当我打开:用PHP读取.CONF文件
$file = fopen("current.conf","r");
$lines = fread($file,"10");
fclose($file);
$lines = "/".$lines."/";
echo $lines;
$dir=opendir($lines);
$files=array();
while (($file=readdir($dir)) !== false)
{
if ($file != "." and $file != ".." and $file != "index.php")
{
array_push($files, $file);
}
}
closedir($dir);
的current.conf只有一个在这行:
2.1-2328
我不能来打开在conf文件命名的文件夹。我有一种感觉,它与conf文件的格式有关,但不确定。
opendir呼叫产生了什么警告? – 2010-12-22 22:20:26
从config中调用的目录是否存在正确? – RageD 2010-12-22 22:26:08