search

Home  >  Q&A  >  body text

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

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

大家讲道理大家讲道理2902 days ago343

reply all(2)I'll reply

  • 迷茫

    迷茫2017-04-10 14:42:56

    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

    reply
    0
  • ringa_lee

    ringa_lee2017-04-10 14:42:56

    js端推荐:ztree

    reply
    0
  • Cancelreply