PHP ftp_mkdir () function
Definition and Usage
ftp_mkdir () function creates a new directory on the FTP server.
If successful, the function returns the name and path of the new directory. If it fails, it returns FALSE.
grammar
ftp_mkdir(ftp_connection,dir)
参数 | 描述 |
---|---|
ftp_connection | 必需。规定要使用的 FTP 连接。 |
dir | 必需。规定要创建的目录的名称。 |
Examples
<?php
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");
echo ftp_mkdir($conn,"testdir");
ftp_close($conn);
?>
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");
echo ftp_mkdir($conn,"testdir");
ftp_close($conn);
?>
The code above will output:
/testdir
Complete PHP FTP Reference