Skip to content

Instantly share code, notes, and snippets.

@swvitaliy
Created August 18, 2012 12:03
Show Gist options
  • Save swvitaliy/3386391 to your computer and use it in GitHub Desktop.
Save swvitaliy/3386391 to your computer and use it in GitHub Desktop.
Php extension removes the specified directory for files
$s='/home/vit/plint/modules/';$a = dir('/home/vit/plint/modules'); while (FALSE !== ($b = $a->read())) { if( ($b === '.' || $b === '..') || is_dir($s.$b)) continue; if (preg_match('/\.php$/',$b)) { $c=substr($b, 0, strlen($b) - 4); print($b . "\t--->\t" . $c . "\t\t\t\t" . (rename($s . $b, $s . $c) ? "OK" : "FAILED!") . "\n"); } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment