 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- 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_delete() function in PHP
The ftp_delete() function is used to delete a file on the FTP server.
Syntax
ftp_delete(con,myfile);
Parameters
- con − The FTP connection 
- myfile − The file to be deleted 
Return
The ftp_delete() function returns TRUE on success or FALSE on failure
Example
The following is an example to delete a file −
<?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");    $myfile = "E:/new/demo.txt";    if (ftp_delete($con, $myfile)) {       echo "The file deleted!";    } else {       echo "The file cannot be deleted!";    }    ftp_close($con); ?>Advertisements
 