arrayobject and directory listing
Posted: Wed Apr 09, 2008 7:11 pm
Hello everyone!!!
I have this problem:
http://pastebin.com/m114f9992
Just to add a few more hints to the problem:
i've manage to get a tree of directorys going, with all hierachy perfect align
dir1
dir1.1
dir 2
(etc)
The problem is: they are not sorted out by name..someone told me i should use arrayobject class to do this...what i'm guessing is i've got to implement some kind of class that will sort out the variable $dir ( that is the result of the recursive directory listing function )
So, i'm calling it like this
$dir = new RecursiveIteratorIterator(new RecursiveDirIterator($directorio_call), true);
foreach ( $dir as $file ) {
etc etc
should it be something like before the for each
$sorted = new ClassThatSorts($dir)
$sorted->sort();
and then the for each?
how can i do this? i've been at a lot of foruns and mirc!
Please!!
Thank you very very very much!!
Ricardo
I have this problem:
http://pastebin.com/m114f9992
Just to add a few more hints to the problem:
i've manage to get a tree of directorys going, with all hierachy perfect align
dir1
dir1.1
dir 2
(etc)
The problem is: they are not sorted out by name..someone told me i should use arrayobject class to do this...what i'm guessing is i've got to implement some kind of class that will sort out the variable $dir ( that is the result of the recursive directory listing function )
So, i'm calling it like this
$dir = new RecursiveIteratorIterator(new RecursiveDirIterator($directorio_call), true);
foreach ( $dir as $file ) {
etc etc
should it be something like before the for each
$sorted = new ClassThatSorts($dir)
$sorted->sort();
and then the for each?
how can i do this? i've been at a lot of foruns and mirc!
Please!!
Thank you very very very much!!
Ricardo
