Advertisement
Guest User

Untitled

a guest
Aug 28th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <?php
  2.  
  3. // The directory that contains the files that you want to rename to lowercase
  4. $directory = "/public_html/media/catalog/product/s/t/";
  5.  
  6. $conn = ftp_connect("website");
  7. ftp_login($conn,"username","password");
  8.  
  9. ftp_pasv($conn,true);
  10.  
  11. ftp_chdir($conn,$directory);
  12. $dir = ftp_nlist($conn,".");
  13.  
  14. foreach($dir as $fsObject)
  15. {
  16. if($fsObject != "." || $fsObject != "..")
  17. {
  18. if($fsObject != strtolower($fsObject))
  19. {
  20. ftp_rename($conn,$fsObject,strtolower($fsObject));
  21. echo strtolower($fsObject)."<br>";
  22. }
  23. }
  24. }
  25.  
  26. ftp_close($conn);
  27. echo $directory."<br>";
  28. echo "Finish!";
  29.  
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement