Rename files to lowercase


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $files = scandir($directory);
  2. foreach($files as $key=>$name){
  3. $oldName = $name;
  4. $newName = strtolower($name);
  5. rename("$directory/$oldName","$directory/$newName");
  6. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.