Thanks, that worked great.
I have another bit of code that reads a directory:
$handle=opendir('files/');
$filelist = "";
while ($file = readdir($handle)) {
if(!is_dir($file) && !is_link($file)) {
$filelist .= '<table width="520" border="0" align="center" cellpadding="0" cellspacing="1"><tr><td valign="top" width="110"><span class="Header">';
$filelist .= "<a href='$upload_dir$file' target='_blank'>".$file."</a>";
$filelist .= '</span></td><td width="300">';
$filelist .= $fileurl.$file;
$filelist .= '</td><td width="40" align="right">';
if ($DELETABLE)
$filelist .= "[<a href='?del=$upload_dir$file' title='delete'>delete</a>]";
$filelist .= '</td><td width="70" align="right">';
$filelist .= "[".date("d-m H:i", filemtime($upload_dir.$file))."]";
$filelist .= '</td></tr></table>';
}
}
I tried applying the same code to it to make it read out alphabetically, but didn't have much luck.
Is there a way to do the same with this code and keep the $filelist variable?
Thanks for your help.