Home >Backend Development >PHP Tutorial >php简单浏览目录内容的实现代码_PHP

php简单浏览目录内容的实现代码_PHP

WBOY
WBOYOriginal
2016-06-01 12:06:43754browse

如下所示:
复制代码 代码如下:
$dir = dirname(__FILE__);
$open_dir = opendir($dir);
echo "

";
echo "";
while ($file = readdir($open_dir)) {
 if ($file!= "." && $file != "..") {
  echo "";
  echo "";
  echo "";
  echo "";
 }

}
echo "

文件名 大小 类型 修改日期
" . $file . "" . filesize($file) . "" . filetype($file) . "" . filemtime($file) . "
";
?>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn