I\'m using this recursive code to read all directories inside another directory, and store them within the parent directory.
protected function readDirs($parent)
scandir returns the . entry, which represents the current directory. You then go to store this directory inside its parent (itself). Thus, recursion.
scandir
.
I suggest ignoring . and ...
..
The "RECURSION" message you got means the data structure cannot be printed in its entirety because it would be infinite.