Skip to content

Instantly share code, notes, and snippets.

@rcrowley
Created October 7, 2009 16:56

Revisions

  1. rcrowley revised this gist Oct 7, 2009. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    unlink($argv[1]);
    $ii = count(explode("/", $argv[1])) - 2;
    for ($i = 0; $i < $ii; ++$i) {
    if (!@rmdir($argv[1] = dirname($argv[1]))) { break; }
    }
  2. rcrowley created this gist Oct 7, 2009.
    4 changes: 4 additions & 0 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    unlink($argv[1]);
    for ($i = 0; $i < $ii; ++$i) {
    if (!@rmdir($argv[1] = dirname($argv[1]))) { break; }
    }