Ver Mensaje Individual
  #8 (permalink)  
Antiguo 28/02/2004, 22:42
Avatar de Manoloweb
Manoloweb
 
Fecha de Ingreso: enero-2002
Ubicación: Monterrey
Mensajes: 2.454
Antigüedad: 22 años, 3 meses
Puntos: 5
Código PHP:
function cuentaArchivos($path
{
$delim "\\\"; 

if($dir=@opendir($path)) 
{
  $key = strrchr($path,$delim);
  $key = substr($key,1,strlen($key));
  
  while(($file=readdir($dir))!== false) 
  {
    if(is_dir($path.$delim.$file) AND $file!= "
." AND $file!= "..") 
    {
      $array[$file] = retrieveDirs($path.$delim.$file);
    }
    elseif($file!= "
." AND $file!= ".." AND preg_match("/(.RTF|.TXT|.rtf|.txt)/",$file)) 
    {
    $array[] =$file;
    }
    }
  closedir($dir);
}
return $array;
}

$archivos=cuentaArchivos($path)
// $archivos ahora tiene una lista de los archivos
$cuantos=count($archivos);
// $cuantos tiene el total de archivos, ahora solo 
// le agregas 1 cuando quieras nombrar el que sigue 
__________________
Manoloweb