What I'm looking for is a way to create a function in which a child folder goes through it and back in the directory hierarchy to find the first matching file that is listed.
Example: I can say that I have a directory structure: Home / Folder 1 / Folder 2 / Folder 3
And I'm looking for a style.css file.
I would like to start pointing to the child folder (Folder 3) and look for style.css, and if it is not there, it will continue the parent folder (Folder 2) and so on. But he should not go further than Folder 1.
If anyone has a good idea, how with that I will be very grateful!
source share