Posted By

jrobinsonc on 08/06/10


Tagged

directory


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

maxid


Función para obtener el tamaño de un directorio


 / Published in: PHP
 

Función para obtener el tamaño de un directorio:

  1. function dirSize($directory) {
  2. $size = 0;
  3. foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)) as $file){
  4. $size+=$file->getSize();
  5. }
  6. return $size;
  7. }

Report this snippet  

You need to login to post a comment.