<?php
for ($i = 0; $i < $elems; $i++) {
$item = trim($cats[$i]); // 移除換行
$ifile = ereg_replace(" ", "", $item); // 檔名去空格
$color = ($ifile == $topic) ? "pink" : "silver"; // 當前分類高亮
$url = "index.php3?topic=$ifile";
$anchor = ($item != $topic) ? $item : "$item";
echo "$anchor ";
}
?>
file() 讀取分類檔,每行含換行需 trim()?: 控制高亮樣式The Arts → TheArts$storyfile = fopen("s$story.txt", "r");
fpassthru($storyfile); // 直接輸出檔案內容至瀏覽器並關閉
編輯模組 author.php3 負責以正確 HTML 格式儲存故事檔。