sort()-help needed
| From: | �ystein H�land | Date: | Tue, 20 Aug 2002 22:02:08 +0000 |
| Subject: | sort()-help needed | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-113385@lists.php.net to get a copy of this message | ||
When calling the function createLinks() I get an unsorted result, and that's
NOT what I want. But I'm not able (lack of knowlegde) to sort the output
(the links).
<?php
function createLinks() {
$handle=opendir(".");
echo "<UL>\n";
while ($file = readdir($handle)){
if (($file == ".") || ($file == "..") || ($file == "index.php") ||
($file
== basename ($PHP_SELF))) { continue; }
if(is_file($file)) {
$linktext = ucfirst ($file);
$linktext = substr_replace ($linktext,'',-4);
echo "<LI> <A
HREF=\"$file\">$linktext</A>\n";
}
}
echo "</UL>\n";
return true;
}
?>