PHP ftp_delete()Function


PHP FTP 参考手册Complete PHP FTP Reference Manual

Definition and Usage

The ftp_delete() function deletes a file on the FTP server.

If successful, this function returns TRUE. If it fails, it returns FALSE and a warning.

Syntax

ftp_delete(ftp_connection,file)

Parameters Description
ftp_connection Required. Specifies the FTP connection to use.
file Required. Specifies the path of the file to be deleted.


Example

<?php
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");

echo ftp_delete($conn,"test.txt");

ftp_close($conn);
?>

The above code will output:

1


PHP FTP 参考手册Complete PHP FTP Reference Manual Other Extensions