【发布时间】:2014-05-27 14:08:22
【问题描述】:
我想在 php 中打开一个目录,然后显示下载该文件的链接。
这就是我正在尝试的。
if(is_dir($dir))
{
$op=opendir($dir);
echo"Files in the directiry are<br>";
while(($file=readdir($op))!==false)
{
if(strpos($file,$ext,1))
{
echo "<a href=apps/".$file .">".$file."</a><br>";
}
}
}
这显示下载链接,但仅显示空间。
【问题讨论】: