Glob

Recursive Filesearch using the PHP Glob function

Jul 31, 2012

A really simple snippet of code that I tend to use when doing big imports of data into a database system. It is rare that the people preparing the files are perfect at following file naming conventions so being able to allow for a bit of flexibility is vital and this tends to do the job. Performance wise this isn’t great because you do a lot of searching that you probably shouldn’t need to do but that is up to the developer to either work around or just be aware of.