迷茫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