HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Rename a directory + a file
The rename() function renames a file or directory.
Parameter | Description |
---|---|
old | Required. Specifies the file or directory to be renamed |
new | Required. Specifies the new name for the file or directory |
context | Optional. Specifies the context of the file handle. Context is a set of options that can modify the behavior of a stream |
Return Value: | TRUE on success, FALSE on failure |
---|---|
PHP Version: | 4.0+ |
PHP Changelog: | PHP 5.3.1: Allow renaming files across drives in Windows. PHP 5.0: Can be used with some URL wrappers. |
❮ PHP Filesystem Reference