Current Location: Home> Function Categories> rename

rename

Rename a file or directory
Name:rename
Category:File system
Programming Language:php
One-line Description:A file or directory that is duplicated.

Definition and usage

rename() function renames a file or directory.

If successful, the function returns true. If it fails, return false.

Example

 <?php
rename ( "images" , "pictures" ) ;
?>

grammar

 rename ( oldname , newname , context )
parameter describe
oldname Required. Specifies the file or directory to be renamed.
newname Required. Specify the new name of the file or directory.
context Optional. Specifies the environment for file handles. context is a set of options that can modify the behavior of a stream.
Similar Functions
Popular Articles