WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

PHP ftp_rename () function


Definition and usage

ftp_rename () Function Renames a file or directory on an FTP server.

If successful, the function returns TRUE. If it fails, it returns FALSE.

Syntax

ftp_rename (ftp_connection, from, to)

parameters description
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.


Example

<?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);
?>