Ok, a very odd thing to ask for help with, but i've been trying to do it for ages now, and i cant for the life of me work out how its done.
Say i've got a load of directories and files that look like this:
/Folder1/somePage.php
/Folder1/anotherPage.php
/Folder1/subFolder/blah.php
/Folder2/hrmm.html
/Folder3/yay.htm
page.php
anotherpage.php
and I wanted to put them in an array with this structure:
array(array("Folder1", array("somePage.php", "anotherPage.php", array("subFolder", array("blah.php", "erk.php")))), array("Folder2", array("hrmm.html")), array("Folder3", array("yay.htm")), array ("page.php"), array("anotherpage.php"));
AKA
Array ( [0] => Array ( [0] => Folder1 [1] => Array ( [0] => somePage.php [1] => anotherPage.php [2] => Array ( [0] => subFolder [1] => Array ( [0] => blah.php [1] => erk.php ) ) ) ) [1] => Array ( [0] => Folder2 [1] => Array ( [0] => hrmm.html ) ) [2] => Array ( [0] => Folder3 [1] => Array ( [0] => yay.htm ) ) [3] => Array ( [0] => page.php ) [4] => Array ( [0] => anotherpage.php ) )
does anyone have a clue how i'd do it?
I mean, actually reading the file directories and putting them in the array like that?
I know this is a really really odd thing to ask for help with, but it's for something i've set up that is able to handle an array that looks like that.
any ideas?