PHP ftp_mkdir()Function
Complete PHP FTP Reference Manual
Definition and Usage
The 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.
Syntax
ftp_mkdir(ftp_connection,dir)
| Parameter | Description |
|---|---|
| ftp_connection | Required. Specifies the FTP connection to use. |
| dir | Required. Specifies the name of the directory to create. |
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 Manual Other Extensions