I need to store all directories and files in multidimensional array for a given location (sample : /path/to/folder) . It should include the sub folders as well no matter how deep.
Edited :
I tried with php scandir and it gave me following results,
code :
$dir = '/path/to/folder';
$files = scandir($dir);
print_r($files);
results :
Array
(
[0] => .
[1] => ..
[2] => folder1
[3] => file1
.....
)
What I need is to get the content inside the folder1 and do it continuously till I get complete folder structure with all files.
P.S : I need to remove "." and ".." from the result array too.