ftp_rename

PHP 4, PHP 5, PHP 7, PHP 8
ftp_rename - Renames a file or a directory on the FTP server
Manual
Code Examples

ftp_rename( FTP\Connection$ftp, string$from, string$to ): bool

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

Parameters

ftp

An FTP\Connection instance.

from

The old file/directory name.

to

The new name.

Return Values

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.

Changelog

Version Description
8.1.0 The ftp parameter expects an FTP\Connection instance now; previously, a resource was expected.

Example of ftp_rename

Show all examples for ftp_rename

PHP Version: