Home  >  Article  >  Backend Development  >  php简单浏览目录内容的实现代码_php技巧

php简单浏览目录内容的实现代码_php技巧

WBOY
WBOYOriginal
2016-05-17 09:02:481003browse

如下所示:

复制代码 代码如下:

$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