Tema: Por que
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/02/2005, 10:20
Avatar de Reynier
Reynier
 
Fecha de Ingreso: noviembre-2002
Ubicación: Por ahí en algún sitio
Mensajes: 1.844
Antigüedad: 21 años, 4 meses
Puntos: 1
Por que

Estoy tratando de listar todo el contenido de una carpeta pero tengo problemas al hacerlo. Este es el código:
Código PHP:
global $dirthumb;
  
$path getcwd();
  
$pathtodir substr(substr($path,0,-1),0,strrpos($path,"\\"));
  
$files = array();
  if(
is_dir($pathtodir.$dirthumb)){
    if(
$handle opendir($pathtodir.$dirthumb)){
     while(
$file readdir($handle) != false){
      if(
$file!="." && $file!=".."){
       
$files[] = $file;
      }
     }
     
closedir($handle);
    }
  }
  
sort($files); 
la carpeta posee esta estructura:
Cita:
D:\wamp\www\morgandir\fotos\thumbs
luego dentro de la carpeta thumbs tengo todo esto:
Cita:
thumbs/
foto1.jpg
foto2.jpg
foto3.jpg
foto4.jpg
foto5.jpg
por lo que algo debería tener el arreglo $files[] o me equivoco ??
Alguna sugerencia.
Salu2
__________________
Ing. Reynier Pérez Mira