PHP ftp_mkdir() 함수
예시
FTP 서버에 새 디렉터리를 만듭니다.
<?php
// connect and login to FTP server
$ftp_server = "ftp.example.com";
$ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
$login = ftp_login($ftp_conn, $ftp_username, $ftp_userpass);
$dir = "images";
// try to create directory $dir
if (ftp_mkdir($ftp_conn, $dir))
{
echo "Successfully created $dir";
}
else
{
echo "Error while creating $dir";
}
// close connection
ftp_close($ftp_conn);
?>
정의 및 사용
ftp_mkdir() 함수는 FTP 서버에 새 디렉토리를 생성합니다.
통사론
ftp_mkdir(ftp_conn, dir);
매개변수 값
Parameter | Description |
---|---|
ftp_conn | Required. Specifies the FTP connection to use |
dir | Required. Specifies the name of the directory to create |
기술적 세부 사항
반환 값: | 성공 시 새 디렉토리의 이름, 실패 시 FALSE |
---|---|
PHP 버전: | 4+ |
❮ PHP FTP 참조