PHP函数ftp_exec介绍
定义和用法
ftp_exec() 函数请求在 FTP 服务器上执行一个程序或命令。
若成功(服务器发送响应代码 200),则返回 true,否则返回 false。
语法
ftp_exec(ftp_connection,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);?>
本文出自:琅枫个人博客。如需转载请注明出处!
本文出处:"https://www.langfujun.top/function/326.html"
如果您觉得文章对你有帮助,可以进行打赏。
打赏多少,您高兴就行,谢谢您对琅枫博客的支持! ~(@^_^@)~
微信打赏

支付宝打赏
