PHP unlink() 함수
❮ PHP 파일 시스템 참조예시
파일 삭제:
<?php
$file = fopen("test.txt","w");
echo fwrite($file,"Hello World. Testing!");
fclose($file);
unlink("test.txt");
?>
정의 및 사용
unlink() 함수는 파일을 삭제합니다.
통사론
unlink(filename, context)
매개변수 값
Parameter | Description |
---|---|
filename | Required. Specifies the path to the file to delete |
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.0 - 컨텍스트 매개변수 추가 |
❮ PHP 파일 시스템 참조