"; echo ""; echo "
Index of /
"; foreach ($items as $n) { if ($n === '.' || $n === '..') continue; // 跳過 . .. $href = rawurlencode($n); // 正確轉跳 $text = htmlspecialchars($n, ENT_QUOTES, 'UTF-8'); // 避免 XSS/亂碼 echo "
$text
"; } echo "
"; // 檔尾不要加 "?>"