how to move images from one folder to another using php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
adsegzy
Forum Contributor
Posts: 184
Joined: Tue Jul 28, 2009 9:26 am

how to move images from one folder to another using php

Post by adsegzy »

How do i move or copy a file that is already in one of my website online folders to another.
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: how to move images from one folder to another using php

Post by Jonah Bron »

To move or copy files, you want either rename() or copy(), respectively.

http://php.net/rename
http://php.net/copy

I know it sounds funny, but yes, you move files with the rename() function.
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: how to move images from one folder to another using php

Post by twinedev »

And at a linux shell prompt, to rename a file, you use the mv (move) command.... LOL
Post Reply