Home>Article>Backend Development> A wonderful encyclopedia of rename() in PHP

Therename()function of PHPis equivalent to the ## inunix#shellCommandmv, it not only has a simple renaming function, but can also change the path of files or even entire directories.
1. Syntax:
rename(oldname,newname,context)
contextis a set of options that can modify the behavior of the stream.
TRUEon success,FALSEon failure.
2. Purpose:
##3. Example:
a. To rename the file:b. www.txt is moved from file1
to thefile2directory.
Both win32 and unix versions ofphp4support this function. The win32 version of php4 has canceled theunlink()function.
Recommended: "php video tutorial" "php tutorial"
The above is the detailed content of A wonderful encyclopedia of rename() in PHP. For more information, please follow other related articles on the PHP Chinese website!