Home > Backend Development > PHP Tutorial > 【求思路】PHP目录扫描,最大防止死循环的思路?该如何解决

【求思路】PHP目录扫描,最大防止死循环的思路?该如何解决

WBOY
Release: 2016-06-13 11:28:50
Original
862 people have browsed it

【求思路】PHP目录扫描,最大防止死循环的思路?
PHP扫描某个文件夹,防止死循环的思路。
现在自己想到的只有两种思路
1, while 扫描下去,如果碰到目录继续while。容易死机卡住
2,层级扫描,扫描一层然后保存目录地址到记录文件。然后再从保存的记录文件中提取目录地址再扫描一层,每次只扫描一层。不过如果目录太多,还是容易死机。
有没有更好的思路?

目录扫描 PHP opendir
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template