hello friends,
How can i rename a file(text or jpg file) which is placed inside a folder using php??????does anybody have a code for this
rename a file using PHP
Moderator: General Moderators
Re: rename a file using PHP
Here you go:
or
- matt
Code: Select all
rename($oldfilename, $newfilename);
Code: Select all
exec("mv $oldfilename $newfilename");
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Re: rename a file using PHP
i have to make it using a function and not just have to use "rename" function.i have to make a function like this
function rename($dirpath,$oldfilename,$newfilename)
and this function must be recursive and a directory can contain subdirectory also
function rename($dirpath,$oldfilename,$newfilename)
and this function must be recursive and a directory can contain subdirectory also
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
