Easy Tutorial
❮ Func Array Current Filter Validate Regexp ❯

PHP rename() Function



Definition and Usage

The rename() function renames a file or directory.

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

Syntax

Parameter Description
oldname Required. Specifies the file or directory to be renamed.
newname Required. Specifies the new name for the file or directory.
context Optional. Specifies the environment of the file handle. Context is a set of options that can modify the behavior of a stream.

Example


❮ Func Array Current Filter Validate Regexp ❯