blueman378 Posted March 6, 2008 Share Posted March 6, 2008 hi guys, well ia need a code which checks all files in the current directory and runs a preg replace on the name to get rid of some letters infront of the names< how owuld i go about doing this? eg abcbob.php abckat.php abcmat.php i want a code that will rename them to bob.php kat.php mat.php cheers Link to comment https://forums.phpfreaks.com/topic/94657-code-to-batch-rename-files/ Share on other sites More sharing options...
Isityou Posted March 6, 2008 Share Posted March 6, 2008 1. Open Directory - opendir() 2. Read Directory - readdir() 3. Change file names - rename() http://us2.php.net/manual/en/function.rename.php Link to comment https://forums.phpfreaks.com/topic/94657-code-to-batch-rename-files/#findComment-484667 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.