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

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 />';
}

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


js端推荐:ztree

【热门文章】
【热门文章】