原文由双瞳翻译。(这里是简要,详情请看全文)
发布时间:08-02-18
原文:
Antoine Ughetto has posted an easy way to find a file inside any series of subdirectories with PHP:
I've made a previous post on SPL using RecursiveIterator to parse Array. Today we will use this same RecursiveIterator with a DirectoryRecursiveIterator.
The code is pretty simple and straight forward - a DirectorySearch class that takes in the directory name and recurses through the files and subdirectories to locate the file you're looking for.
译文:
Antoine Ughetto有个简便的方法,用PHP 来查找一堆子文件夹中的文件。
我先前在 SPL 上发过一篇关于用 RecursiveIterator 追踪数组的文章。现在我们将再次使用RecursiveIterator连同DirectoryRecursiveIterator。
代码相当简单明了-一个DirectorySearch类提取文件目录名称并递归所有文件和子目录, 定位查找文件。
» 阅读全文