search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

Programming Dictionary

Online technical manual for service programmers
Popular searches:
Dictionary homepage Server PHP php rename() function
php rename() function Detailed instructions for use

php rename() function

Chinese translation Recent Updates: 2018-04-19 14:34:43

UK[ˌri:ˈneɪm] US[ˌriːˈneɪm]

vt. Rename..., change its name

Third person singular: renames Present participle: renaming Past tense: renamed Past participle: renamed

php rename() function syntax

Function:Rename files or directories.

Syntax: rename(oldname,newname,context)

##Parameters:

ParametersDescriptionoldnameRequired. Specifies the file or directory to be renamed. newnameRequired. Specifies the new name of the file or directory. contextOptional. Specifies the environment for a file handle. context is a set of options that modify the behavior of the stream.

Note: The encapsulation protocol used in oldname must match the one used in newname.

php rename() function example

<?php
$file = "test.txt";
$res = rename($file,"index.txt");
if($res)
{
    echo "文件重命名成功";
}else{
    echo "文件重命名失败";
}
?>

Run instance »

Click the "Run instance" button to view the online instance

php rename() function