(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)
ftp_get_option — 返回當前 FTP 連接的各種不同的選項設置
此函數會(huì )返回連接句柄為 ftp_stream
,指定鍵值 option
的值。
ftp_stream
FTP 連接資源句柄。
option
截止到目前,支持的選項有:
FTP_TIMEOUT_SEC |
返回當前設定的網(wǎng)絡(luò )操作的超時(shí)時(shí)間。 |
FTP_AUTOSEEK |
此選項打開(kāi)時(shí)返回 true ,否則返回 false 。
|
如果成功則返回選項的值,否則,如果給定的參數 option
選項不被支持則返回 false
,同時(shí)會(huì )拋出一條警告(warning)信息。
示例 #1 ftp_get_option() 示例
<?php
// Get the timeout of the given FTP stream
$timeout = ftp_get_option($conn_id, FTP_TIMEOUT_SEC);
?>