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 네트워크 참조