ftp_delete()函数用于删除FTP服务器上的文件。
ftp_delete(con,myfile);
con -FTP连接
myfile-要删除的文件
ftp_delete()函数成功返回TRUE或失败返回FALSE
以下是删除文件的示例-
<?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); ?>