Heim  >  Artikel  >  Backend-Entwicklung  >  php简单浏览目录内容_PHP教程

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

WBOY
WBOYOriginal
2016-07-15 13:21:37859Durchsuche

<?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...
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn