태그로 반환 * * @param string $path 폴더 경로 * @param string $select_name 셀렉트 태그의 name 속성 * @param string $select_id 셀렉트 태그의 id 속성 * @param string|null $selected_folder 기본 선택된 폴더명 * @return string \n"; // 디렉토리 확인 if (is_dir($path)) { $folders = scandir($path); foreach ($folders as $folder) { // '.'와 '..' 제외, 폴더인지 확인 if ($folder !== '.' && $folder !== '..' && is_dir($path . '/' . $folder)) { $folder_escaped = htmlspecialchars($folder, ENT_QUOTES, 'UTF-8'); $selected = ($folder === $selected_folder) ? ' selected' : ''; $select_html .= "\n"; } } } else { $select_html .= "\n"; } $select_html .= "\n"; return $select_html; }