(PHP 4, PHP 5, PHP 7)
rmdir — Removes directory
$dirname
[, resource $context
] )
Attempts to remove the directory named by dirname
.
The directory must be empty, and the relevant permissions must permit this.
A E_WARNING
level error will be generated on failure.
dirname
Path to the directory.
context
Note: Context 지원은 PHP 5.0.0에서 추가되었습니다. contexts에 관한 자세한 설명은 Streams을 참고하십시오.
성공 시 TRUE
를, 실패 시 FALSE
를 반환합니다.
버전 | 설명 |
---|---|
5.0.0 | As of PHP 5.0.0 rmdir() can also be used with some URL wrappers. Refer to Supported Protocols and Wrappers for a listing of which wrappers support rmdir(). |
Example #1 rmdir() example
<?php
if (!is_dir('examples')) {
mkdir('examples');
}
rmdir('examples');
?>
Note: 안전 모드를 활성화했을 경우, PHP는 작업하려는 디렉토리가 실행중인 스크립트와 같은 UID(owner)를 가지고 있는지 확인합니다.