rename

rename

Sequentially Rename All Image Files In A Directory With PHP

Monday, March 2, 2009 - 12:36

The 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.

Category: 

Moving Files In PHP

Tuesday, November 11, 2008 - 11:05

I 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.

Category: