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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.