category * and sections: * category * with each section being an 'unordered list' of links: *
  • link * description *
  • * It is not necessary to sort the links file beforehand. */ $links=file("links.txt"); for ($line=0; $line < count($links); $line++) { $current=trim($links[$line]); // category, url, name, description list($l_c,$l_u,$l_n,$l_d)=explode("|",$current); $cats[$line]="$l_c"; $links[$line]=$current; } sort($cats); reset($cats); /* take only 1 of each category for the anchor tags */ $cats_u=array_unique($cats); sort($cats_u); reset($cats_u); sort($links); reset($links); if ($debug=="on"){ for ($count=0; $count < count($cats); $count++){ echo "
    cats[$count]= $cats[$count]\n"; } for ($count=0; $count < count($cats_u); $count++){ echo "
    cats_u[$count]= $cats_u[$count]\n"; } } $_head=" Top
    \n"; for ($cnt=0; $cntcats_u[$cnt]=$cats_u[$cnt] \n"; } // not pretty, but it's the best place i've found to close the \n"; } else { $_body[$cnt]=""; } $_head .= " $cats_u[$cnt]  \n"; $_body[$cnt].= "

    $cats_u[$cnt]

    \n [back to Top]\n"; $_body[$cnt].= " \n"; ?>