(PHP 4, PHP 5)
mkdir — Makes directory
Attempts to create the directory specified by pathname.
The directory path.
The mode is 0777 by default, which means the widest possible access. For more information on modes, read the details on the chmod() page.
Note: mode is ignored on Windows.
Note that you probably want to specify the mode as an octal number, which means it should have a leading zero. The mode is also modified by the current umask, which you can change using umask().
Default to FALSE.
Note: Context 지원은 PHP 5.0.0에서 추가되었습니다. contexts에 관한 자세한 설명은 Stream 함수 목록을 참고하십시오.
성공할 경우 TRUE를, 실패할 경우 FALSE를 반환합니다.
버전 | 설명 |
---|---|
5.0.0 | The recursive parameter was added |
5.0.0 | As of PHP 5.0.0 mkdir() can also be used with some URL wrappers. Refer to 지원 프로토콜/래퍼 목록 for a listing of which wrappers support mkdir() |
4.2.0 | The mode parameter became optional. |
Example #1 mkdir() example
<?php
mkdir("/path/to/my/dir", 0700);
?>
Note: 안전 모드를 활성화했을 경우, PHP는 작업하려는 디렉토리가 실행중인 스크립트와 같은 UID(owner)를 가지고 있는지 확인합니다.