renameFile.php
Table of Contents
Functions
- renameFile() : bool
- Renames a single file.
Functions
renameFile()
Renames a single file.
renameFile(string $source, string $destination[, bool $overwrite = true ][, bool $createDirectory = true ]) : bool
Semantic alias of moveFile(): renaming a file is the same operation as moving it (the destination may be a new name in the same directory, a path in another directory, or an existing directory to move into). See moveFile() for the full destination, overwrite and cross-filesystem semantics.
Parameters
- $source : string
-
Path to the source file to rename.
- $destination : string
-
New file path, or an existing directory to move into.
- $overwrite : bool = true
-
Whether to overwrite an existing destination file (default:
true). - $createDirectory : bool = true
-
Whether to create the destination directory if missing (default:
true).
Tags
Return values
bool —Returns true on success.