RecursiveTreeIterator 生成树状文件结构
<?php
$files = new RecursiveDirectoryIterator('common');
$files->setFlags(RecursiveDirectoryIterator::SKIP_DOTS | RecursiveDirectoryIterator::UNIX_PATHS);
$files = new RecursiveTreeIterator($files);
$files->setPrefixPart(RecursiveTreeIterator::PREFIX_LEFT, '⋇');
$files->setPrefixPart(RecursiveTreeIterator::PREFIX_END_HAS_NEXT, '⊩');
$files->setPrefixPart(RecursiveTreeIterator::PREFIX_END_HAS_NEXT, '≀');
$files->setPrefixPart(RecursiveTreeIterator::PREFIX_END_LAST, '∿');
foreach ($files as $file) {
echo $file . '<br />';
}