我有一个问题,从文件夹中读取文件(在本例中称为“上传”):
这是脚本:
<div id="content">
<?php
echo "<h2> These is the list of the files: </h2>";
$dir = dir("upload");
while (($file = $dir->read()) !== false) {
echo "<p>File name: " . $file . "</p>";
}
$dir->close();
?>
</div>
结果如下:
These is the list of the files:
File name: .
File name: ..
File name: prova.txt
File name: prova2.txt
File name: prova3.txt
File name: prova4.txt
它有效,因为正在从文件夹中读取内容。但是我怎样才能避免显示前两行呢?那两条线是什么?为什么会显示它们?