File_Find::maptree() -- create a view map for a directory
Описание
Map the directory tree given by the directory_path parameter.
Возвращаемое значение
array - a two element array, the first
element containing a list of all the directories, the second
element containing a list of all the files.
Заметка
Эта функция может быть вызвана статически.
Пример
Пример 39-1. Get the map of a directory include "File/Find.php";
$dir = "File_Find";
list($directories, $files) = File_Find::maptree($dir);
echo "Directories ";
print_r($directories);
echo "Files ";
print_r($files); |
The above example will output something similar to: Directories Array
(
[0] => File_Find
[1] => File_Find\dir2
[2] => File_Find\dir2\2
[3] => File_Find\dir2\1
[4] => File_Find\dir2\0
[5] => File_Find\dir
[6] => File_Find\dir\txtdir
[7] => File_Find\dir\dir3
[8] => File_Find\dir\dir2
)
Files Array
(
[0] => File_Find\dir2\2\1.txt
[1] => File_Find\dir2\1\1.txt
[2] => File_Find\dir2\0\1.txt
[3] => File_Find\dir\1.txt
[4] => File_Find\dir\2.txt
[5] => File_Find\dir\txtdir\5.txt
[6] => File_Find\dir\dir3\4.bak
[7] => File_Find\dir\dir3\4.txt
[8] => File_Find\dir\dir2\3.bak
[9] => File_Find\dir\dir2\3.txt
) |
|
HIVE: All information for read only. Please respect copyright! |
|