I m trying to rename files to lowercase within a directory, however the problem I'm having is being able to scan the sub-directories for the files.
So in this case $app_dir
is the main directory and the files I need to change exist within multiple sub-folders.
Heres my code so far:
$files = scandir($app_dir);
foreach($files as $key=>$name){
$oldName = $name;
$newName = strtolower($name);
rename("$app_dir/$oldName","$app_dir/$newName");
}
Thanks for your help.