Đăng kí thành viên · Quên MK?

Lần hoạt động

Diễn đàn | Wap Web | Php - Sql
Tìm kiếm
  CODE LIỆT KÊ DANH SÁCH CÁC FILE CÓ TRONG THƯ MỤC VÀ THƯ MỤC CON (SUBFOLDER)
Admin  Admin [FOUNDER]
 
PRO
(03.01.2019 / 20:15) TOP
PHP CODE :


<?php
function ListFolder($path)
{
//using the opendir function
$dir_handle = @opendir($path) or die("Unable to open $path");

//Leave only the lastest folder name
$dirname = end(explode("/", $path));

//display the target folder.
echo ("<li>$dirname\n");
echo "<ul>\n";
while (false !== ($file = readdir($dir_handle)))
{
if($file!="." && $file!="..")
{
if (is_dir($path."/".$file))
{
//Display a list of sub folders.
ListFolder($path."/".$file);
}
else
{
//Display a list of files.
echo "<li>$file</li>";
}
}
}
echo "</ul>\n";
echo "</li>\n";

//closing the directory
closedir($dir_handle);
}
?>
<script language="JavaScript" type="text/javascript">
<!--
dmxListToTree({
bullets : 'plusminus',
icons : true,
struct : false,
objId : 'FolderView'
});
//-->
</script>
<ul class="dmxtree" id="FolderView">
<?php ListFolder("images"); ?>
</ul>

201 Lượt xem chủ đề  Tổng số: 1 Comment

Cùng chuyên mục
Lọc theo tác giả
Xem chủ để ngoại tuyến (Offline)

Trong diễn đàn

Sắp xếp theo thứ tự từ trên xuống
Forum.GiaiTri321.Info
Trang chủ
0 / 1

DucVuVip.Pro - Diễn Đàn DucVuVip.Pro, Chia Sẻ Code, Thủ Thuật Wap/Webmaster 6.2.1

© Forum.GiaiTri321.Info