PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<realpathrewind>
Last updated: Mon, 16 Jul 2012

rename

(PHP 3, PHP 4, PHP 5)

rename -- 文件重命名

说明

bool rename ( string oldname, string newname )

尝试把 oldname 重命名为 newname

如果成功则返回 TRUE,失败则返回 FALSE

例子 1. rename() 例子

<?php
rename
("/tmp/tmp_file.txt", "/home/user/login/docs/my_file.txt");
?>

注: 在 PHP 4.3.3 之前,rename() 不能在基于 *nix 的系统中跨磁盘分区重命名文件。

参见 copy()unlink()move_uploaded_file()




<realpathrewind>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST