PHP ftp_rename() Function

The ftp_rename() function renames a file or directory on the FTP server.

bool ftp_rename ( resource $ftp_stream , string $oldname , string $newname )

ftp_rename() renames a file or a directory on the FTP server.

Example -

ParameterDescription
ftp_streamThe link identifier of the FTP connection
oldnameThe old file/directory name
newnameThe new name

Returns TRUE on success or FALSE on failure. Upon failure (such as attempting to rename a non-existent file), an E_WARNING error will be emitted.