The rename() function renames a file or directory.This function returns TRUE on success, or FALSE on failure.
bool rename ( string $oldname , string $newname [, resource $context ] )
Attempts to rename oldname to newname, moving it between directories if necessary. If renaming a file and newname exists, it will be overwritten. If renaming a directory and newname exists, this function will emit a warning.
Parameter | Description |
---|---|
oldname | Specifies the file or directory to be renamed |
newname | Specifies the new name of the file or directory |
context | Specifies the context of the file handle. Context is a set of options that can modify the behavior of a stream |