(PHP 4, PHP 5)
rename — Renames a file or directory
Attempts to rename oldname to newname .
Note: The old name. The wrapper used in oldname must match the wrapper used in newname .
The new name.
Note: Context 지원은 PHP 5.0.0에서 추가되었습니다. contexts에 관한 자세한 설명은 Stream 함수 목록을 참고하십시오.
성공할 경우 TRUE를, 실패할 경우 FALSE를 반환합니다.
버전 | 설명 |
---|---|
5.0.0 | rename() can now also be used with some URL wrappers. Refer to 지원 프로토콜/래퍼 목록 for a listing of which wrappers support rename(). |
4.3.3 | rename() is now able to rename files across partitions on *nix based systems. |
Example #1 Example with rename()
<?php
rename("/tmp/tmp_file.txt", "/home/user/login/docs/my_file.txt");
?>