Ver Mensaje Individual
  #6 (permalink)  
Antiguo 24/02/2002, 06:42
Avatar de Ferdy
Ferdy
Colaborador
 
Fecha de Ingreso: junio-2001
Ubicación: España
Mensajes: 1.430
Antigüedad: 22 años, 10 meses
Puntos: 0
Re: Número de directorios en un directorio especifico.

Ok, no funciona, jeje ahí va la corrección:<pre>&lt;?php
/**
* int num_dirs(string dir [, int cont ])
**/
function num_dirs($dir,$cont=false)
{
if ($cont===false)
{
$cont = 0;
}
$dp = opendir($dir);
while ( $ent = readdir($dp) )
{
if ( is_dir($ent) &amp;&amp; $ent != &quot;.&quot; &amp;&amp; $ent != &quot;..&quot; )
{
$cont++;
$cont += num_dirs($ent,$cont);
}
}
closedir($dp);
return $cont;
}
?&gt; </pre> Ahora ya debería ir ;)

Salu2.Feliz Codding

- Fernando Pereda ( Ferdy )
<center><a href="http://www.ferdyx.org/firmas.php"><img src="http://www.ferdyx.org/reg_tira.jpg" border="0"></a></center>