PHP 터치() 함수
❮ PHP 파일 시스템 참조예시
지정된 파일의 액세스 및 수정 시간을 설정합니다.
<?php
filename = "test.txt";
if (touch($filename)) {
echo
$filename . " modification time has been changed to present time";
} else {
echo "Sorry, could not change modification time of " . $filename;
}
?>
정의 및 사용
touch() 함수는 지정된 파일의 액세스 및 수정 시간을 설정합니다.
참고: 지정된 파일이 없으면 생성됩니다.
통사론
touch(filename, time, atime)
매개변수 값
Parameter | Description |
---|---|
filename | Required. Specifies the file to touch |
time | Optional. Sets the touch time. The current system time is set by default |
atime | Optional. Sets the access time. Default is the current system time if no parameters are set, or the same as the time parameter if that parameter is set |
기술적 세부 사항
반환 값: | 성공하면 TRUE, 실패하면 FALSE |
---|---|
PHP 버전: | 4.0+ |
PHP 변경 로그: | PHP 5.3 - |
❮ PHP 파일 시스템 참조