PHP Function Reference

PHP streamWrapper rename() Method



The PHP streamWrapper::rename() method renames a file or directory. This method is called in response to rename() function.

Note: In order for the appropriate error message to be returned this method should not be defined if the wrapper does not support renaming files.

Syntax

public streamWrapper::rename(path_from, path_to)

Parameters

path_from Required. Specify the URL to the current file.
path_to Required. Specify the URL which the path_from should be renamed to.

Return Value

Returns true on success or false on failure.

Exceptions

Emits E_WARNING if call to this method fails (i.e. not implemented).

Note: The streamWrapper::$context property is updated if a valid context is passed to the caller function.

❮ PHP Streams Reference