note 34248 added to function.sort
| From: | namit at eircom dot net | Date: | Sat, 19 Jul 2003 18:33:28 +0000 |
| Subject: | note 34248 added to function.sort | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-52390@lists.php.net to get a copy of this message | ||
I have it Function but I want to sort the output on it, how can i do this.
<?
function list_files(){
$root = "gallery";
// Open a known directory, and proceed to read its contents
if (is_dir($root)) {
if ($dh = opendir($root)) {
while (($file = readdir($dh)) !== false){
////////////////////SORT THIS////////////////////
echo "<tr><td><center><a href=imageupload.php?dir=$root/$file
border='0'>$file</a><br>\n</center></td></tr>";
}
closedir($dh);
}
}
}
list_files()
?>
----
Manual Page -- http://www.php.net/manual/en/function.sort.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34248
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34248&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34248&report=yes