How to use Filesystem rename in PHP

In this article I am going to explain about rename function in PHP.
  • 1480

PHP rename() Function

The filesystem rename function renames a file or directory.

Syntax of rename function

rename(oldname, newname, context)

Parameters in rename function

It have three parameter:

Parameter Description
oldname Specifies old filename.
newname Specifies new filename.
context Specifies the context of the file handle.

Example of filesystem rename function




echo rename("add.php","sum.php");






You may also want to read these related articles :

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here


More Articles

© 2020 DotNetHeaven. All rights reserved.