
26/04/2005, 03:59
|
 | | | Fecha de Ingreso: junio-2004 Ubicación: Vive en el foro
Mensajes: 190
Antigüedad: 20 años, 9 meses Puntos: 2 | |
Ejemplo 1. dir() Ejemplo
$d = dir("/etc");
echo "Handle: ".$d->handle."<br>\n";
echo "Path: ".$d->path."<br>\n";
while($entry=$d->read()) {
echo $entry."<br>\n";
}
$d->close();
Ejemplo 2. readdir() Ejemplo
<?php
$handle=opendir('.');
echo "Directory handle: $handle\n";
echo "Files:\n";
while ($file = readdir($handle)) {
echo "$file\n";
}
closedir($handle);
?>
La función readdir() lee también los ficheros "." y ".." así que tendrías que comprobar eso. No sé si te servirá esto, espero que sí... |