Re: recursive direcotry listing
| From: | David T-G | Date: | Fri, 06 Feb 2004 21:55:47 +0000 |
| Subject: | Re: recursive direcotry listing | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-177053@lists.php.net to get a copy of this message | ||
Binay, et al --
..and then Binay said...
%
% Hi all,
Hiya!
%
% is there function which scans a particual directory recurisly and stores the content in array or
other way? Listing of files should be in alphabetical way and directories should come on top.
Yep. Get the File_Find pear module and just
$find = new File_Find ;
$separate = $find->maptree(".") ;
$mixed = $find->maptreemultiple(".") ;
Now $separate looks like
Array
(
[0] =>
(
[0] => .
[1] => ./d1
),
[1] =>
(
[0] => ./f1
[1] => ./f2
[2] => ./d1/f3
)
)
and $mixed looks like
Array
(
[0] => f1
[1] => f2
[d1] =>
Array
(
[0] => f3
)
)
%
% Thanks
%
% Binay
HTH & HAND
:-D
--
David T-G * There is too much animal courage in
(play) davidtg@justpickone.org * society and not sufficient moral courage.
(work) davidtgwork@justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur
Pbzzhavpngvbaf Qrprapl Npg!