PHP ftp_exec () Funktion
Definition und Verwendung
ftp_exec () Funktion zu beantragen, ein Programm oder einen Befehl auf dem FTP-Server auszuführen.
Wenn dies gelingt, gibt die Funktion TRUE. Wenn es fehlschlägt, wird FALSE zurückgegeben.
Grammatik
ftp_exec(ftp_connection,command)
参数 | 描述 |
---|---|
ftp_connection | 必需。规定要使用的 FTP 连接。 |
command | 必需。规定发送到 FTP 服务器的命令请求。 |
Tipps und Hinweise
HINWEIS: Bei ftp_raw () Funktion unterscheidet, ftp_exec () erst , nachdem Sie auf den FTP - Server anmelden Befehle zu senden.
Beispiele
<?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);
?>
$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);
?>
Füllen Sie PHP FTP - Referenz