
getservbyport()函数获取与端口和协议相对应的Internet服务。
语法
string getservbyport ( int $port , string $protocol )
定义和用法
用于获取与端口号相对应的Internet服务
返回值
以字符串形式返回Internet服务名称。失败时返回false。
参数
| 序号 | 参数和说明 |
|---|---|
| 1 | port 端口号 |
| 2 | protocol 协议是“ tcp”或“ udp”(小写)。 |

getservbyport()函数获取与端口和协议相对应的Internet服务。
string getservbyport ( int $port , string $protocol )
用于获取与端口号相对应的Internet服务
以字符串形式返回Internet服务名称。失败时返回false。
| 序号 | 参数和说明 |
|---|---|
| 1 | port 端口号 |
| 2 | protocol 协议是“ tcp”或“ udp”(小写)。 |