Posted By

cochambre on 06/30/06


Tagged

delete folder tree erase files


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

luman
neverwolf
postNuKe
nicolaspar
ibomb


Borra una carpeta y todos sus archivos


 / Published in: PHP
 

  1. function borrarTodo($raiz){
  2. if($objs = glob($raiz."/*")){
  3. foreach($objs as $obj) {
  4. is_dir($obj)? borrarTodo($obj) : unlink($obj);
  5. }
  6. }
  7. rmdir($raiz);
  8. }

Report this snippet  

You need to login to post a comment.