ftp_close

(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)

ftp_close關(guān)閉一個(gè) FTP 連接

說(shuō)明

ftp_close(resource $ftp_stream): bool

ftp_close() 關(guān)閉給出的連接標(biāo)識(shí)符并釋放資源。

注意:

調(diào)用本函數(shù)后,將不能再使用 FTP 連接,必須用 ftp_connect() 建立一個(gè)新連接。

參數(shù)

ftp_stream

FTP 連接的標(biāo)識(shí)符。

返回值

成功時(shí)返回 true, 或者在失敗時(shí)返回 false。

范例

示例 #1 ftp_close() 例子

<?php

// set up basic connection
$conn_id ftp_connect($ftp_server);

// login with username and password
$login_result ftp_login($conn_id$ftp_user_name$ftp_user_pass);

// print the current directory
echo ftp_pwd($conn_id); // /

// close this connection
ftp_close($conn_id);
?>

參見(jiàn)