PHP 이름 바꾸기() 함수
❮ PHP 파일 시스템 참조예시
디렉토리 + 파일 이름 바꾸기:
<?php
rename("images","pictures");
rename("/test/file1.txt","/home/docs/my_file.txt");
?>
정의 및 사용
rename() 함수는 파일 또는 디렉토리의 이름을 바꿉니다.
통사론
rename(old, new, context)
매개변수 값
Parameter | Description |
---|---|
old | Required. Specifies the file or directory to be renamed |
new | Required. Specifies the new name for the file or directory |
context | Optional. Specifies the context of the file handle. Context is a set of options that can modify the behavior of a stream |
기술적 세부 사항
반환 값: | 성공하면 TRUE, 실패하면 FALSE |
---|---|
PHP 버전: | 4.0+ |
PHP 변경 로그: | PHP 5.3.1: Windows에서 드라이브 간에 파일 이름 바꾸기를 허용합니다. PHP 5.0: 일부 URL 래퍼와 함께 사용할 수 있습니다. |
❮ PHP 파일 시스템 참조