A getservbyname() example:
<?php
$portnum = getservbyname("http", "tcp");
echo $portnum;
?>
The getservbyname() function returns the port number for a given Internet service and protocol.
getservbyname(
service, protocol)
Parameter | Description |
---|---|
service | Required. Specifies the Internet service name (like "http") |
protocol | Required. Specifies a protocol name (like "tcp" or "udp") |
Return Value: | The port number on success. FALSE on failure |
---|---|
PHP Version: | 4.0+ |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!