网络编程
位置:首页>> 网络编程>> php编程>> php简单浏览目录内容的实现代码

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

  发布时间:2023-10-25 01:32:43 

标签:php,浏览目录

如下所示:


<?php
$dir = dirname(__FILE__);
$open_dir = opendir($dir);
echo "<table border=1 borderColor=red cellpadding=6>";
echo "<tr><th>文件名</th><th>大小</th><th>类型</th><th>修改日期</th></tr>";
while ($file = readdir($open_dir)) {
 if ($file!= "." && $file != "..") {
  echo "<tr><td>" . $file . "</td>";
  echo "<td>" . filesize($file) . "</td>";
  echo "<td>" . filetype($file) . "</td>";
  echo "<td>" . filemtime($file) . "</td></tr>";
 }

}
echo "</table>";
?>

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com