Ver Mensaje Individual
  #3 (permalink)  
Antiguo 15/11/2008, 04:31
Avatar de nanduky
nanduky
 
Fecha de Ingreso: octubre-2008
Ubicación: Corbera del Llobregat
Mensajes: 33
Antigüedad: 15 años, 6 meses
Puntos: 2
Respuesta: meter datos de un directorio en un array

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