参数 | 描述 |
---|---|
ftp_connection | 必需。规定要使用的 FTP 连接(FTP 连接的标识符)。 |
command | 必需。规定发送到服务器的命名请求。 |
该函数发送一个 SITE EXEC command 请求到 FTP 服务器。
与 ftp_raw() 函数 不同,ftp_exec() 只有在登录到 FTP 服务器后才能发送命令。
<?php
$command = "ls-al > test.txt";
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");
if (ftp_exec($conn,$command)
)
{
echo "Command executed successfully";
}
else
{
echo "Execution of command failed";
}
ftp_close($conn);
?>
制作:
http://www.7di.net 生活网搜集整理 参考: http://www.w3school.com.cn/php/func_ftp_exec.asp |