Current Location: Home> Function Categories> ftp_rename

ftp_rename

Rename a file or directory on the FTP server.
Name:ftp_rename
Category:Uncategorized
Programming Language:php
One-line Description:Rename a file or directory on the FTP server.

Definition and usage

ftp_rename() function changes the file or directory name on the FTP server.

Return true if successful, otherwise return false.

实例

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

grammar

 ftp_rename ( ftp_connection , from , to )
parameter describe
ftp_connection Required. Specifies the FTP connection to be used (the identifier of the FTP connection).
from Required. Specifies the file or directory to be renamed.
to Required. Specify the new name of the file or directory.
Similar Functions
Popular Articles