Advertisement
Kimeraweb

Lectura de ficheros

Oct 24th, 2011
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.55 KB | None | 0 0
  1. <?
  2.     $lista_de_ficheros = array_diff( scandir("."), array("..",".") );
  3.     $directorios = 0;
  4.     $bytes = 0;
  5.     $count = 0;
  6.     foreach($lista_de_ficheros as $array => $nombre)
  7.     {
  8.         if (is_dir($nombre))
  9.         {
  10.             $directorios++;
  11.         }
  12.     }
  13.     require ("config.php");
  14.     $query = "Select ID,size from baf_files";
  15.     $mk = mysql_query($query);
  16.     while($a = mysql_fetch_array($mk))
  17.     {
  18.         $bytes += $a['size'];
  19.         $count++;
  20.     }
  21.     echo "Hay un total de ".number_format($bytes)." bytes en ".$count." archivos.<br>";
  22.     echo "Hay ".$directorios." categorias creadas.<br>";
  23. ?>
  24.  
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement