$path . '/' . $item, array_filter( scandir($path), fn ($item) => ! in_array($item, ['.', '..']) ) ) ); } public function scandirMultiple(string|array $paths): array { $paths = (array)$paths; $merged = []; foreach ($paths as $path) { $scanned = $this->scandir($path); array_push($merged, ...$scanned); } return $merged; } }