Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/11/2008, 03:39
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
meter datos de un directorio en un array

Buenas.

tengo el siguiente codigo:

Código PHP:
<?php
$dir 
"fichas/";

if (
is_dir($dir)) {
    if (
$gd opendir($dir)) {
        while ((
$archivo readdir($gd)) !== false) {
         if (
$archivo != "." && $archivo != "..") {
            echo 
$archivo.'<br>';
            
        }}
        
closedir($gd);
    }
}
?>
que me debuelve:

Código HTML:
<html>

archivo4.txt
archivo1.txt
archivo2.txt
archivo5.txt
archivo3.txt

</html> 
¿Como podria cojer eso datos para meterlos en un array?
Es para poder ordenarlos alfabeticamente los que ya hay mas los que se vallan guardando en el directorio (fichas/).