Skip to content

Instantly share code, notes, and snippets.

@abrahamvegh
Created January 25, 2010 00:43
Show Gist options
  • Save abrahamvegh/285548 to your computer and use it in GitHub Desktop.
Save abrahamvegh/285548 to your computer and use it in GitHub Desktop.
<?php
function rm_r($input)
{
if (is_file($input))
{
return @unlink($input);
}
else if (is_dir($input))
{
$scan = glob(rtrim($input,'/').'/*');
foreach ($scan as $index => $path)
{
rm_r($path);
}
return @rmdir($input);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment