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


/ Published in: PHP
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.