Muchas gracias, Deschamps.
funciona perfecto:
Código PHP:
$dir = "fichas/";
if (is_dir($dir)) {
if ($gd = opendir($dir)) {
while (($archivo = readdir($gd)) !== false) {
if ($archivo != "." && $archivo != "..") {
$ficheros[] = $archivo;
}
}
$cont = count($ficheros);
for($i = 0;$i < $cont;$i++){
sort($ficheros);
echo $ficheros[$i].'<br>';
}
closedir($gd);
}
}
Código HTML:
<html>
archivo1.txt
archivo2.txt
archivo3.txt
archivo4.txt
archivo5.txt
</html