【PHP】質問スレッドpart31【php】
■ このスレッドは過去ログ倉庫に格納されています
0066nobodyさん
2005/11/28(月) 11:36:21ID:ig9+vMm1function scan_directories($dir) {
$file_array = array();
if (is_dir($dir)) {
$dh = opendir($dir);
chdir($dir);
while (false !== ($filename = readdir($dh))) {
array_push($file_array, $filename);
}
closedir($dh);
foreach ($file_array as $file) {
if (is_dir($file) && !is_parent_or_current($file)) {
scan_directories($file);
} elseif (is_file($file)) {
//ファイルに関する処理
}
}
}
こういう関数を作ったんですが、ひとつのディレクトリを降りていくだけで、
ほかのディレクトリが無視されます。どうしたら全部のディレクトリとファイル
を見付けてくれるのでしょう?
■ このスレッドは過去ログ倉庫に格納されています