PHP 복사() 함수
❮ PHP 파일 시스템 참조예시
"source.txt"를 "target.txt"로 복사:
<?php
echo copy("source.txt","target.txt");
?>
정의 및 사용
copy() 함수는 파일을 복사합니다.
참고: to_file 파일이 이미 있는 경우 덮어씁니다 .
통사론
copy(from_file, to_file, context)
매개변수 값
Parameter | Description |
---|---|
from_file | Required. Specifies the path to the file to copy from |
to_file | Required. Specifies the path to the file to copy to |
context | Optional. Specifies a context resource created with stream_context_create() |
기술적 세부 사항
반환 값: | 성공하면 TRUE, 실패하면 FALSE |
---|---|
PHP 버전: | 4.0+ |
PHP 변경 로그: | PHP 5.3 - 컨텍스트 매개변수 추가 |
❮ PHP 파일 시스템 참조