I wrote this script when my Windows 98 screwed up my filename. It was index.php and changed into Index.php, in a big number of files within a directory 🙁
< ?php
// I name it caser.php
$handle = opendir($argv[1]);
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
rename("$argv[1]/$file",strtolower("$argv[1]/$file"));
echo "$file renamed
";
}
}
closedir($handle);
?>
Usage:C:php4> php.exe caser.php c:apachehtdocs [enter]
Have fun!
Leave a Reply