Rename files inside a directory
Copy and paste the following code into your editor and run it (code comments are included).
You can add as many features as you wish from this piece of code.
This example browses a directory to list files and rename all files except the ones we do not want to list (as 'Thumbs.db' on windows or '..' and '.' which are not files as well as a directory itself).
The source code:
Notes:
- we use the is_dir function to avoid renaming a directory;
- you need to have the necessary permissions to be able to write into a file on your server (see chmod on linux/unix).
You may wish to read additional materials from:
- http://us.php.net/rename
- function.opendir.php
- function.readdir.php
- function.is-dir.php
Comments
No comment yet, write the first now here or onto our webmaster forum
|
Webmaster Corner
The Millionaire league
Dozens of Easy and Automatic Ways to
Make Money Online Everyday!
Niche Annihilation Method Crush Your Competition! Download the method Now
iPowerWeb

Incredible Membership Packages - Web Hosting!
One Month Free Trial! ProStores - an eBay Company
Gain customers, increase sales, and boost profits with your own Web Store.
→ Get Google Pay-Per-Click Ads Free!
→ Automated Cash Formula $$$

|
Categories
|