rename()

— Renames a file or directory Description bool rename ( string $oldname , string $newname [, resource $context ] ) Attempts to rename oldname to newname .

fwrite() example

Description int fwrite ( resource $handle , string $string [, int $length ] ) fwrite() writes the contents of string to the file stream pointed to by handle .