- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
ftp_mkdir() function in PHP
The ftp_mkdir() function is used to create a new directory on the FTP server.
Syntax
ftp_mkdir(con,dir);
Parameters
con − The FTP connection
dir − The name of the directory to be created
Return
The ftp_mkdir() function returns name of the directory on success, or FALSE on failure
Example
The following is an example that creates a new directory −
<?php $ftp_server="192.168.0.4"; $ftp_user="amit"; $ftp_pass="tywg61gh"; $con = ftp_connect($ftp_server) or die("Could not connect to $ftp_server"); $login = ftp_login($con, $ftp_user, $ftp_pass); $newdir = "new.txt"; if (ftp_mkdir($con, $newdir)){ echo "Created the new directory successfully!"; } else { echo "The new directory cannot be created!"; } ftp_close($con); ?>
Advertisements