I have an array containing full paths of files. Like this:
[0] => "dir1/dir2/dir3/file.ext"
[1] => "dir1/dir2/dir3/file2.ext"
[2] => "dir1/dir2/dir3/file3.ext"
[3] => "dir2/dir4/dir5/file.ext"
I need to parse it and get a multidimensional array, something like this:
[dir1] => [dir2] => [dir3] => file.ext
=> file2.ext
=> file3.ext
[dir2] => [dir4] => [dir5] => file.ext
Any ideas? Must work with various depth of the structure.