glob 函数实现原理

WBOY
Release: 2016-06-23 14:16:38
Original
1351 people have browsed it

glob 函数实现原理??? 


回复讨论(解决方案)

这需要什么原理?就是调用os的api接口,能解析路径、定位路径、遍历查找目录所有文件和目录、返回结果

如果你真追究实现原理的话,可以看看php的源码实现,百度一搜一堆。

就是封装了一个获取遍历目录下文件的方法,然后通过正则过滤点不符合条件的文件,将符合条件的文件保存到数组最后返回。

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