PHP chmod() 함수
❮ PHP 파일 시스템 참조예시
"test.txt" 파일에 대한 권한 변경:
<?php
// Read and write for owner, nothing for everybody else
chmod("test.txt",0600);
// Read and write for owner, read for everybody else
chmod("test.txt",0644);
// Everything for owner, read and execute for everybody else
chmod("test.txt",0755);
// Everything for owner, read for owner's group
chmod("test.txt",0740);
?>
정의 및 사용
chmod() 함수는 지정된 파일의 권한을 변경합니다.
통사론
chmod(file, mode)
매개변수 값
Parameter | Description |
---|---|
file | Required. Specifies the path to the file |
mode | Required. Specifies the new permissions. The mode parameter consists of four numbers:
Possible values (to set multiple permissions, add up the following numbers):
|
기술적 세부 사항
반환 값: | 성공하면 TRUE, 실패하면 FALSE |
---|---|
PHP 버전: | 4.0+ |
❮ PHP 파일 시스템 참조