Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
getting ALL directories in a directory into an array
Man i've been posting too many questions but.. here's another one i'm having trouble with.. basically a programming problem not necessarilly php only... i want to be able to take a directory.. well hell i'll make a tree or something to view:
what i would like to do is start with the main directory... and read in all directories and sub directories.. of course there would be a limit to how many subdirectories that could be read probably. To show what i'm asking... with the above tree i'd have these results in an array:
I hope that makes sense. Anyway... for some reason i feel like recursion would be an option but that's just my inner instinct.. who follows that :-) Can someone help me with this problem? Knowing php there's probably one function that does it haha but i've been struggling to figure it out since i'm stupid. Thanks much!