PHP ftp_set_option() 函数
PHP 教程
· 2019-01-26 13:14:07
定义和用法
ftp_set_option() 函数设置 FTP 连接的各种运行时选项。
如果成功,该函数返回 TRUE。如果失败,则返回 FALSE。
语法
ftp_set_option(ftp_connection,option,value)
| 参数 | 描述 |
|---|---|
| ftp_connection | 必需。规定要使用的 FTP 连接。 |
| option | 必需。规定要设置的运行时选项。可能的值:
|
| value | 必需。设置 option 参数的值。 如果 option 参数设置为 FTP_TIMEOUT_SEC,则表示它将对网络操作的最大可执行时间做出限制(单位:秒)。 如果 option 参数设置为 FTP_AUTOSEEK,则该参数必须是 TRUE(打开自动搜索功能)或者 FALSE(关闭自动搜索功能)。 |
实例
<?php
$conn = ftp_connect("ftp.testftp.com") or die("Could not connect");
ftp_login($conn,"admin","ert456");
ftp_set_option($conn,FTP_TIMEOUT_SEC,120);
ftp_close($conn);
?>
点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html
Programming PHP
Rasmus Lerdorf、Kevin Tatroe、Peter MacIntyre / O'Reilly Media / 2006-5-5 / USD 39.99
Programming PHP, 2nd Edition, is the authoritative guide to PHP 5 and is filled with the unique knowledge of the creator of PHP (Rasmus Lerdorf) and other PHP experts. When it comes to creating websit......一起来看看 《Programming PHP》 这本书的介绍吧!