Skip to content

Instantly share code, notes, and snippets.

View yuri-ellfort's full-sized avatar
😈

Yuri Ellfort yuri-ellfort

😈
View GitHub Profile
<?php
/**
* Creates a tree-structured array of directories and files from a given root folder.
*
* Gleaned from: http://stackoverflow.com/questions/952263/deep-recursive-array-of-directory-structure-in-php
*
* @param string $dir
* @param string $regex
* @param boolean $ignoreEmpty Do not add empty directories to the tree
* @return array