Rename file directory in php - Mostlikers

17 July, 2014

Rename file directory in php

 PHP rename() function changed old directory to new directory If new name exists, it will be overwritten. Sometime wrongly uploaded file images or folder that time use this function easy to rename the new directory or image name. 


Sample code

rename ("/folder/old.jpg", "/folder/new.jpg");
rename ("/uploads/old.pdf", "/uploads/new.pdf");

No comments:

Post a Comment