PHP 教程 PHP 表单 PHP 高级教程 PHP 数据库 PHP XML PHP 与 AJAX PHP 参考手册

发布于 2016-11-18 14:32:57 | 76 次阅读 | 评论: 0 | 来源: 网络整理


定义和用法

ftp_exec() 函数请求在 FTP 服务器上执行一个程序或命令。

如果成功,该函数返回 TRUE。如果失败,则返回 FALSE。

语法

 ftp_exec(ftp_connection,command) 

参数描述
ftp_connection必需。规定要使用的 FTP 连接。
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);
 ?> 


最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务