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

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

WBOY
Release: 2016-06-01 12:06:43
Original
752 people have browsed it

如下所示:
复制代码 代码如下:
$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) . "
";
?>
Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template