PHP help
- Started
- Last post
- 8 Responses
- Stugoo
dear php gods
I'm trying to create a php array that recursivley flows down directories and drops them into the array as such
level0 : '
'
- Stugoo0
doh.
I'm trying to create a php array that recursively flows down directories and drops them into the array and outputs is as a json Array as per the following example:
http://pastebin.com/RSsUWmqwA friend hooked me up with the following php but i cant get my head around how to nest the arrays as I need them.
http://pastebin.com/K1LYC9XCcan anyone help?
- vaxorcist0
hmm.. do you need the recursive "tree-walking" directory "scanner" to dump everything into a "flat" array, or an array of arrays that reflects the directory tree structure?
- vaxorcist0
this may be of help if you need to reflect the same structure, not go flat....
- vaxorcist0
this looks useful too....
- ernexbcn0
Read the 1st answer here:
- uan0
how about http://php.net/manual/en/functio… scandir ?
from the examples:
This function will scan all files recursively in the sub-folder and folder- the class I linked to (RecursiveDirectoryI... is better than this function, this doesn't go recursivelyernexbcn
- Stugoo0
Thanks everyone, the scanDir really sorted me out!
http://pastebin.com/UgjDae7VI looked at that link from you emexbcn before, I couldnt get it to work. I really need to brush up on my PHP.