Skip to content

Instantly share code, notes, and snippets.

@wowo
Created March 9, 2010 08:13
Show Gist options
  • Save wowo/326376 to your computer and use it in GitHub Desktop.
Save wowo/326376 to your computer and use it in GitHub Desktop.
<?php
$path = ($tmp = $_SERVER['argv'][1]) ? $tmp : '.';
foreach (scandir($path) as $filepath) {
if (strpos($filepath, '\\')) {
$properFilepath = str_replace('\\', '/', $filepath);
@mkdir(dirname($properFilepath), 0777, true);
rename($filepath, $properFilepath);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment