Home > Backend Development > PHP Tutorial > PHP:开发类似“查看目录文件”的程序

PHP:开发类似“查看目录文件”的程序

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:47:08
Original
1046 people have browsed it

PHP:开发类似“查看目录文件”的程序

想要一个开发类似于上图所示的界面,可以帮忙推荐下相关插件(一般是使用jquery吧)吗?

回复内容:

PHP:开发类似“查看目录文件”的程序

想要一个开发类似于上图所示的界面,可以帮忙推荐下相关插件(一般是使用jquery吧)吗?

Javascript部分用Tree之类的插件。

PHP部分用SPL迭代器,网上给你找了段说明性质的代码。

try{
    /*** class create new DirectoryIterator Object ***/
    foreach ( new DirectoryIterator('./') as $Item )
    {
        echo $Item . '|' . $Item->getSize() . '|' . $Item->getATime() 
.'|' . $Item->getMTime() .'|' . $Item->isDir() .  '<br>';
    }
}
    /*** if an exception is thrown, catch it here ***/
catch(Exception $e){
    echo 'No files Found!<br />';
}
Copy after login

http://www.php.net/manual/zh/class.directoryiterator.php

js端推荐:ztree

Related labels:
php
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template