私は今、ここで少し道に迷っています。私の目標は、各サブフォルダーにサブフォルダーと画像を含むフォルダーを再帰的にスキャンし、それを多次元配列に取得してから、各サブフォルダーをそれに含まれる画像で解析できるようにすることです。
基本的にファイルを含む各サブフォルダーをスキャンし、マルチアレイに入れるために失われた次の開始コードがあります。
$dir = 'data/uploads/farbmuster';
$results = array();
if(is_dir($dir)) {
$iterator = new RecursiveDirectoryIterator($dir);
foreach(new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::CHILD_FIRST) as $file) {
if($file->isFile()) {
$thispath = str_replace('\\','/',$file->getPath());
$thisfile = utf8_encode($file->getFilename());
$results[] = 'path: ' . $thispath. ', filename: ' . $thisfile;
}
}
}
誰かがこれで私を助けることができますか?
前もって感謝します!