PHP ftp_delete () function
Definition and Usage
ftp_delete () function deletes a file on the FTP server.
If successful, the function returns TRUE. If it fails, FALSE and a warning is returned.
grammar
ftp_delete(ftp_connection,file)
参数 | 描述 |
---|---|
ftp_connection | 必需。规定要使用的 FTP 连接。 |
file | 必需。规定要删除的文件的路径。 |
Examples
<?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);
?>
$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 code above will output:
1
Complete PHP FTP Reference