PHP ftp_exec() 函数

PHP 教程 · 2019-01-26 07:44:26

定义和用法

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);
?> 


点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

Text Processing in Python

Text Processing in Python

David Mertz / Addison-Wesley Professional / 2003-6-12 / USD 54.99

Text Processing in Python describes techniques for manipulation of text using the Python programming language. At the broadest level, text processing is simply taking textual information and doing som......一起来看看 《Text Processing in Python》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

SHA 加密
SHA 加密

SHA 加密工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具