PHP getservbyport()関数
例
getservbyport()の例:
<?php
$intservname = getservbyport(80, "tcp");
echo $intservname;
?>
定義と使用法
getservbyport()関数は、指定されたポートとプロトコルのインターネットサービスを返します。
構文
getservbyport(port, protocol)
パラメータ値
Parameter | Description |
---|---|
port | Required. Specifies the port number (like 80) |
protocol | Required. Specifies a protocol name (like "tcp" or "udp") |
技術的な詳細
戻り値: | 成功したインターネットサービスの名前 |
---|---|
PHPバージョン: | 4.0以降 |
❮PHPネットワークリファレンス