$url = \'http://site.com/images/name.jpg\';
Its a full path for the file, which is already exists on ftp.
How can I change file\'s name
if your script on the server root (http://site.com/script.php) that script will do:
http://site.com/script.php
rename('images/oldname.jpg', 'images/newname.jpg');
since that's the relative path of the image from the script point of view.