A fast way to rename folders (or files - with a small modification) to lowercase.
$usrfilespath = 'yourfolder/';
if(is_dir($usrfilespath)) {
$files = scandir($usrfilespath);
foreach($files as $key=>$name){
if($name !== '.' && $name !== '..' && is_dir($usrfilespath . '/' . $name)){
rename( $usrfilespath . '/' . $name, $usrfilespath . '/' . strtoupper($name) );
echo ( $usrfilespath . '/' . $name . '<br>' . $usrfilespath . '/' . strtolower($name) . '<br><br>' );
}
}
$ToOutput .= 'OK: Folders renamed to lowercase<br>';
} else {
$ToOutput .= 'ERROR: No folders to rename<br>';
}
echo $ToOutput
Comments
Post a Comment