递归目录列表(显示完整目录结构)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了递归目录列表(显示完整目录结构)相关的知识,希望对你有一定的参考价值。
Takes advantage of the SPL. Much easier and maintainable than the previous revisions. Haven't done any benchmarks yet but I imagine it is much faster. "If you want to omit directories, remove the RecursiveIteratorIterator::SELF_FIRST part."
<?php $objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST); foreach($objects as $name => $object){ echo "$name "; } ?>
以上是关于递归目录列表(显示完整目录结构)的主要内容,如果未能解决你的问题,请参考以下文章