rename
rename
Sequentially Rename All Image Files In A Directory With PHP
Mon, 03/02/2009 - 12:36 | by philipnorton42The following function will rename all of the image files in a directory to be sequential. The parameters are the path of the directory that the files are in and the name of a function that will be used to sort the array of files through the PHP usort() function.
Moving Files In PHP
Tue, 11/11/2008 - 11:05 | by philipnorton42I have been asked a couple of times recently if PHP has a function that will move a file, so I thought I would put the solution here.
PHP has a function called rename() which can be used to rename a file, but because of the way it works it can be used to move files. Let's say that you wanted to rename a file called test.txt to test_back.txt, this can be accomplished by doing the following.