Rumah  >  Artikel  >  pembangunan bahagian belakang  >  php简单浏览目录内容_PHP教程

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

WBOY
WBOYasal
2016-07-15 13:21:37859semak imbas

<?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...
Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn