I am developing an admin panel that shows the directory structure of a specific location on server. I have got a recursive php function that iterates through every file and
I've made a gist of a build tree class. It uses RecursiveDirectoryIterator and produce an array or a JSON for ajax purpose.
RecursiveDirectoryIterator
JSON
Here it is: https://gist.github.com/jonataswalker/3c0c6b26eabb2e36bc90