PHP ftp_systype()関数
例
FTPサーバーのシステムタイプを取得します。
<?php
// connect and login to FTP server
$ftp_server = "ftp.example.com";
$ftp_conn = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
$login = ftp_login($ftp_conn, $ftp_username, $ftp_userpass);
// get system type
if ($type = ftp_systype($ftp_conn))
{
echo "System type is: $type";
}
else
{
echo "Could not get system type.";
}
// close connection
ftp_close($ftp_conn);
?>
出力は次のようになります。
System type is: UNIX
定義と使用法
ftp_systype()関数は、FTPサーバーのシステムタイプ識別子を返します。
構文
ftp_systype(ftp_conn);
パラメータ値
Parameter | Description |
---|---|
ftp_conn | Required. Specifies the FTP connection to use |
技術的な詳細
戻り値: | 成功した場合はシステムタイプ、失敗した場合はFALSE |
---|---|
PHPバージョン: | 4歳以上 |
❮PHPFTPリファレンス