首頁  >  文章  >  後端開發  >  php简单浏览目录内容_PHP教程

php简单浏览目录内容_PHP教程

WBOY
WBOY原創
2016-07-15 13:21:37861瀏覽

<?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>";
?>

 

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/477173.htmlTechArticle?php$dir = dirname(__FILE__);$open_dir = opendir($dir);echo table border=1 borderColor=red cellpadding=6;echo trth文件名/thth大小/thth类型/thth修改日期/th/tr;while ($fil...
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn