Rename a file or directory in PHP

Description

The following code shows how to rename a file or directory.

Example


 /*from  w  w  w.  j  a va 2 s. c  o  m*/
  
<?php
    rename("test.txt","test_copy.txt");
    rename("test_copy.txt","test.txt");
?>




















Home »
  PHP Tutorial »
    File »




Directory
DirectoryIterator
Drive
File
File Permission
File Read Save
FileSystemIterator
Path
Zip