Skip to content

Instantly share code, notes, and snippets.

@toledorobia
Last active January 5, 2018 15:11
Show Gist options
  • Select an option

  • Save toledorobia/0308c77c961cc6d48b3d to your computer and use it in GitHub Desktop.

Select an option

Save toledorobia/0308c77c961cc6d48b3d to your computer and use it in GitHub Desktop.

Revisions

  1. Jonathan Toledo Orobia renamed this gist Jan 5, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. Jonathan Toledo Orobia revised this gist Jan 5, 2018. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion main.php
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,10 @@
    <?php
    function rmdir_recursive($dir) {
    foreach(scandir($dir) as $file) {
    if ('.' === $file || '..' === $file) continue;
    if (is_dir("$dir/$file")) rmdir_recursive("$dir/$file");
    else unlink("$dir/$file");
    }
    rmdir($dir);
    }
    }
    ?>
  3. Jonathan Toledo Orobia renamed this gist Jan 5, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. Jonathan Toledo Orobia revised this gist Jan 5, 2018. No changes.
  5. toledorobia renamed this gist May 7, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  6. toledorobia created this gist May 7, 2015.
    8 changes: 8 additions & 0 deletions index.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    function rmdir_recursive($dir) {
    foreach(scandir($dir) as $file) {
    if ('.' === $file || '..' === $file) continue;
    if (is_dir("$dir/$file")) rmdir_recursive("$dir/$file");
    else unlink("$dir/$file");
    }
    rmdir($dir);
    }