The ftp_rename() function renames a file or directory on the FTP server.
If successful, the function returns TRUE. If it fails, returns FALSE.
ftp_rename(ftp_connection,from,to)
parameter | describe |
---|---|
ftp_connection | Required. Specifies the FTP connection to use. |
from | Required. Specifies the file or directory to be renamed. |
to | Required. Specifies the new name of the file or directory. |
<?php$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");ftp_login($conn,"admin","ert456");ftp_rename($conn,"oldname.txt" ,"newname.txt");ftp_close($conn);?>