示例
<?php $value = getservbyport(137, "udp"); ?>
getservbyname() 同理(PHP 4, PHP 5, PHP 7, PHP 8)
getservbyport — 获取与端口和协议对应的互联网服务
getservbyport() 根据 /etc/services 返回与指定 protocol 的 port 关联的互联网服务。
port端口号。
protocol
protocol 为 "tcp" 或 "udp"(小写)。
返回互联网服务名称(字符串),失败则返回 false。