|
|
(Next) File_Find::search() |
||||
| |
|||||
|
|||||
array
&File_Find::mapTreeMultiple (
string $directory
,
integer $maxrecursion = 0
,
integer $count = 0
)
directory_path パラメータによって与えられたディレクトリツリーをマップします。 取得するディレクトリのコンテンツは、 maxrecursion に依存します。 また、サブディレクトリのコンテンツについても同様です。
string $directory - マップするディレクトリパスを指定します
integer $maxrecursion - サブディレクトリの再帰的なマッピングの深さを定義します
integer $count - 無視することができます。再帰レベルを追うための内部パラメータです。
array - 全てのサブディレクトリとファイルを含む多次元配列。
This function can be called statically.
サブディレクトリを含むディレクトリのコンテンツを取得する
<?php
include "File/Find.php";
$file = File_Find::mapTreemultiple('/usr/', 1);
print_r($file);
?>
上の例の出力は、このようになります。
Array
(
[0] => file1.tmp
[1] => file2.tmp
['bin'] => Array
(
[0] => readme.txt
)
)
|
|
(Next) File_Find::search() |
||||||||
| |
|||||||||
|
|||||||||