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
  • See unlink() or unset() (PHP does not have delete keywords or functions) delete

    delete

    Seeunlink()orunset()
  • Establish symbolic connection symlink

    symlink

    Establishsymboliccon
  • Provide information about the document stat

    stat

    Provideinformationab
  • Positioning in file pointer fseek

    fseek

    Positioninginfilepoi
  • Parse a configuration file parse_ini_file

    parse_ini_file

    Parseaconfigurationf
  • Get file modification time filemtime

    filemtime

    Getfilemodificationt
  • Create a temporary file tmpfile

    tmpfile

    Createatemporaryfile
  • Copy the file copy

    copy

    Copythefile
Popular Articles