ftp_systype
(PHP 4, PHP 5, PHP 7, PHP 8)
ftp_systype — 返回遠端 FTP 伺服器的操作系統型別
說明
ftp_systype(resource
$ftp_stream
): string返回遠端 FTP 伺服器的操作系統型別。
參數
-
ftp_stream
-
FTP 連線資源。
返回值
返回遠端伺服器型別,發生錯誤則返回 false
。
範例
示例 #1 ftp_systype() 示例
<?php
// 建立 ftp 連線
$ftp = ftp_connect('ftp.example.com');
ftp_login($ftp, 'user', 'password');
// 獲取操作系統型別
if ($type = ftp_systype($ftp)) {
echo "Example.com 的操作系統為 $type\n";
} else {
echo "無法獲取操作系統型別";
}
?>
以上例程的輸出類似於:
Example.com 的操作系統為 UNIX